Sending an Outlook Calendar Event

Sending an Outlook Calendar Event

  
Hi all,

Is there an extension that allows me to send an outlook calendar event instead of a regular email?
I'm able to create the vcs file correctly and if I use Outlook to open it, I can send it and it works ok. But I'd like to send it without using outlook.
As anybody developed something to do this?

regards

Hi Gonçalo,

You don't need an extension to do that..You can do that only using the outsystems tools and power ;)
1- Build the content of the file as a text in the correct format, like for example:

"BEGIN:VCALENDAR
                  VERSION:2.0
                  BEGIN:VEVENT
                  STATUS:TENTATIVE
                  DTSTART:"+NewStartDate+"T"+NewStartTime+"Z
                 DTEND:"+NewEndDate+"T"+NewEndTime+"Z
                 LOCATION;ENCODING=QUOTED-PRINTABLE:"+Location+"
                  CATEGORIES:Profissional
                 DESCRIPTION;ENCODING=QUOTED-PRINTABLE:"+Description+"
                  SUMMARY;ENCODING=QUOTED-PRINTABLE:"+Subject+"
                  PRIORITY:3
                  END:VEVENT
                  END:VCALENDAR"


2- Convert your string to binary, using TextToBinaryData method (UTF-8).

3- Use an email screen and in the Preparation do something like this:

 

And here you have what you need..I think I didn't forget anything..Any doubt, just ask..
Note that you can look at this page to: http://support.microsoft.com/kb/287625

Hope this helps..

Best Regards,
Gonçalo Martins
Just a little additional info

for the AttachFile action:
extension: .vcs
mimetype : text/x-vcalendar

And the datetime should be in a special form ...

	Year( InDateTime) + If(Month(InDateTime)<10,"0" ,"" ) + Month(InDateTime) + If( Day(InDateTime) < 10, "0","") + Day(InDateTime) + "T" + If(Hour(InDateTime)<10, "0", "") + Hour(InDateTime) + If(Minute(InDateTime)<10, "0", "") + Minute(InDateTime) + "00Z"
I can confirm it works like a charm :-)
Hey guys. Thanks for the tips. It works, but not exactly as I thought.
I'm not looking to send the vcs as an attachment, but as an email itself, like when you send an appointment request.
Do you know how to do that?
 
Gonçalo Almeida wrote:
Hey guys. Thanks for the tips. It works, but not exactly as I thought.
I'm not looking to send the vcs as an attachment, but as an email itself, like when you send an appointment request.
Do you know how to do that?
 
 
 I don't think it is possible the way you want it ... to me this is an Outlook Special thingy

What you could try to do is add Attendee and Organizer information to the file.
Change the extension into .ICS (mime type  text/calendar) and see what that will bring you

Here are some sample lines how to incorporate these 

ORGANIZER;SENT-BY:"MAILTO:sray@host.com":MAILTO:jsmith@host.com
 
ATTENDEE;RSVP=TRUE:MAILTO:jsmith@host.com
ATTENDEE;RSVP=TRUE;ROLE=REQ-PARTICIPANT:MAILTO:jsmith@host.com
ATTENDEE;RSVP=TRUE;ROLE=CHAIR:MAILTO:jsmith@host.com

For full extensive :-) description see this site http://www.ietf.org/rfc/rfc2445.txt

Hey Joop,

Unfortunatly the result is the same. I think I'll have to develop some extension in .NET to do this (I'll share it afterwards).
Unless the costumer accepts the attachment solution.

thanks anyway ;)

 

Hi Gonçalo,

You have to do an .Net Extension using ExchangeService to create an Appointment.
You will have to do something like this: http://msdn.microsoft.com/en-us/library/exchange/ff597939%28v=exchg.80%29.aspx

Best Regards,
Diogo Miguel

Thanks Diogo, that is very usefull.

Diogo Miguel wrote:
Hi Gonçalo,

You have to do an .Net Extension using ExchangeService to create an Appointment.
You will have to do something like this: http://msdn.microsoft.com/en-us/library/exchange/ff597939%28v=exchg.80%29.aspx

Best Regards,
Diogo Miguel
 
 Hi Diogo,

When you finish your solution it would be interesting to share it with the community, adding your solution to the one I described only using Outsystem logic.
Good luck on that.

Kind Regards,
Gonçalo Martins
See also here: http://en.wikipedia.org/wiki/Transport_Neutral_Encapsulation_Format for some background info.
I and a teammate did this code to create the appointment in outlook.
I hope it help someone.


public void MssCreateAppoitment(string ssEmail, DateTime ssData, string ssAssunto, string ssDescricao, string ssUser_Exchange, string ssPassword_Exchange, string ssDominio_Exchange, string ssURL_Exchange, DateTime ssDuracao, bool ssAllDay, string ssCc_List) {
          
            //Connection
            ExchangeService service = new ExchangeService();
            service.Credentials = new NetworkCredential(ssUser_Exchange, ssPassword_Exchange, ssDominio_Exchange);
            service.Url = new Uri(@"Exchange URL");
            service.ImpersonatedUserId = new ImpersonatedUserId(ConnectingIdType.SmtpAddress, ssEmail);

            // Create the appointment.
            Appointment appointment = new Appointment(service);

            // Add item properties to the appointment.
            appointment.Body = new MessageBody();
            appointment.Body.BodyType = BodyType.Text;
            appointment.Body.Text = ssDescricao;
            appointment.Importance = Importance.High;
            appointment.ItemClass = "IPM.Appointment";
            appointment.Subject = ssAssunto;
            if(ssCc_List != ""){
                string[] emails = ssCc_List.Split(' ');
                foreach (string email in emails)
                {
                    appointment.RequiredAttendees.Add(email);
                }
            }
            appointment.Start = ssData;
            appointment.End = ssDuracao;
            appointment.IsAllDayEvent = ssAllDay;
            appointment.Save(SendInvitationsMode.SendOnlyToAll);
        } // MssCreateAppoitment

Best Regards,
Diogo Miguel

Thanks Diogo, that will be very helpfull, yes.

Hey guys,
I created this on forge: http://www.outsystems.com/NetworkForge/ProjectDetail.aspx?ProjectId=349

Feel free to comment and use.




Well, I made a quick test to see whether it would work (simple edit record with all the parameters, calling the action from the extension), but alas it doesn't work. That is, it returns Error = false and empty error text, but no appointment is created.
Kilian Hekhuis wrote:
Well, I made a quick test to see whether it would work (simple edit record with all the parameters, calling the action from the extension), but alas it doesn't work. That is, it returns Error = false and empty error text, but no appointment is created.
 
 
Hmmm...it worked for me.
What are the input parameters you're using? you don't need to say de password ;)
Nothing weird. I supplied username/domain/password, begin/end date/time, subject, etc.

EDIT: Never mind, when renaming the action (it has a typo in it) Integration Studio found it necessary to create a new, empty action. I'll test it further and come back...
Gonçalo Almeida wrote:
 
 
Hmmm...it worked for me.
What are the input parameters you're using? you don't need to say de password ;)
 
Hello Gonçalo,

I think that the best way to show to Kilian and everyone that could be interested in this extension, is adding an eSpace showing the usage of your action and even some comments to certain steps I think that are important.
Just a tip ;-)

Kind Regards,
Gonçalo Martins
Ok, after fixing the above, I now get this: "The expected XML node type was XmlDeclaration, but the actual type is Element." I'll do some more tests tomorrow to see if I can pinpoint the source of the problem...

EDIT: Couldn't resist doing a last test. It seems the AutodiscoverUrl  isn't working. Could be a permission thing, but I don't have time to look into it.
I corrected the typo and uploaded a new version to the forge ;)
As for your last error Kilian, I can't help you.
It was indeed a problem with AutodiscoverUrl. When setting the Url property to the right URL, it works fine.
Kilian Hekhuis wrote:
It was indeed a problem with AutodiscoverUrl. When setting the Url property to the right URL, it works fine.
 
 
Can you detail a little bit more?
You mean you're not using the AutodiscoverUrl?
Yes, that's what I mean, AutodiscoverUrl didn't work for me. Apparently it's a setting in the server to allow this or not. But since we have a single Exchange server at a fixed location, directly setting the URL posed no problem.
Kilian Hekhuis wrote:
Yes, that's what I mean, AutodiscoverUrl didn't work for me. Apparently it's a setting in the server to allow this or not. But since we have a single Exchange server at a fixed location, directly setting the URL posed no problem.
 
 
Hmmm, ok.
Can you paste the code you changed?

That's rather boring:

//service.AutodiscoverUrl(ssEmailFrom);

service.Url = new Uri((string)AppInfo.GetAppInfo().Tenant.SiteProperties["ExchangeConnector.ExchangeURL"]);

Hi Kilian,

That's a really unsupported way to do it ... if you need a site property in an extension, pass the value as input parameter.


Regards,
João Rosado
Hi João,

I took it from here: http://www.outsystems.com/NetworkForums/ViewTopic.aspx?Topic=Accessing-a-site-property-inside-some-extension, which is written by OutSystems staff (albeit quite a while ago). It works flawlessly, and passing parameters is not always an option (I have extensions that use a dozen site properties).

Best regards,

Kilian
Hi,

Don't want to side-track this thread, but passing parameters is always an option.
If you have extensions using that type of code I recommend changing it.
That the particular line of code is actually deprecared at the moment. From what I know that shouldn't even work at all in 7.0.

Regards,
João Rosado
João Rosado wrote:
Don't want to side-track this thread, but passing parameters is always an option.
If you have extensions using that type of code I recommend changing it.
That the particular line of code is actually deprecared at the moment. From what I know that shouldn't even work at all in 7.0.
 
We're using 6.0, so we're quite safe then. Good to know it's not available in 7.0, as we are considering moving to 7.0 in the near future. Of course it is always possible to pass parameters, but it can be quite cumbersome. I have an extension with some 20 actions, all of which need to know a bunch of configuration settings for connecting to external webservices (certificates, URLs, ports etc.), and having to pass all these every time I make a call is plain stupid. Perhaps OutSystems can actually do something about it, and provide a cleaner way to eSpace site properties, or, maybe even better, add site property-like functionality to extensions.


Sorry for ressurecting this post.
Is there any way to process the answers to an ics from our application?

For example, an attendee answers "yes" to an invite, it stores on google calendar and also on our application. Is it possible?