Hi,

Thanks for this module. I would like to know if you have given any thought to making the confirmation email a icalendar event that can be added to outlook?

I looked through the code and see that the email is generated using a mail function that I think is part of Drupal. So, you are not actually creating the headers to make this an email. It seems that the headers can be specified in an array, but i'm not sure.

I am interested in drupal development and have made some simple modules to modify the look/feel of Drupal for my University, but your module is beyond my pay grade.

I was thinking that I could just add the information to specify the right headers for an icalendar message and then actually write the icalendar message in the text area of the event confirmation email, so that I could use the event tokens when creating the icalendar message.

What do you think? Would you have any way of helping this along or any guidance on what to do would be appreciated.

Comments

dww’s picture

Component: Miscellaneous » Email

I'm vaugely interested in this, but I have no experience with outlook or formatting emails to act as ical events. It'd probably take a fair bit of work to really do this right.

kaw3939’s picture

Hi,

I have done a little research on the topic. I found that this shouldn't be that hard to do I think. It looks like you can specify the headers in the drupal mail function, which is where you specify that the email is an ical event.

Also, this feature would not be specific to outlook, since ical is an open standard used by many email systems. For example, it would work with google mail.

I think that all you would really need to do is create the proper header that contains the event information and pass that to the mail function that you call when the confirmation email is sent. I "Think" that the email would arrive to people not using a calendar system like outlook or gmail as just a regular email, but if it they were, they would have the option to add the event to their calendar.

I think this update would be great!

I am not that familiar with the internals of your module or I might be able to do this myself. At the moment i'm in the process of creating a custom module for work that turns an XML file into a node, so I don't have the time to make these changes myself.

This was useful in figuring this out:

http://en.wikipedia.org/wiki/ICalendar

I need to go to a meeting, but I'll see if I can post some more information that might help with this.

edward.peters’s picture

I would be willing to pay for this feature to be added to the Drupal 6 version of Signup module. Is there someone willing and able to do it?

magnus’s picture

I made a new node type for events by using CCK + Views + Date + Calendar.
In CCK I have a Datetime and some other fields. In the Calendar view i then get the option to output it through iCal.

Works like a charm!

edward.peters’s picture

@seals: many thanks for sharing your experience. Does this configuration allow an email to be generated with functionality which the recipient can use to put the appointment into their Outlook calendar? If so, are you able to give me a few more hints how you did it?

technikh’s picture

I have been interested in doing this and have been able to send outlook invitations in PHP, but I haven't added that to this module. I'd be interested in looking into doing this for some $$$$ : )

edward.peters’s picture

Great! Please give a quote or write me privately if you prefer.

technikh’s picture

Where exactly in the code is this function to send email when the user is signed up?

edward.peters’s picture

I have absolutely no idea! I hope someone else can help you.

technikh’s picture

I figured it out and implemented the Ical Outlook functionality in signup module.
In my next reply I will put the link so that you can try out the demonstration...

technikh’s picture

You can try out the demonstration here.
http://mydevel.technikh.com/

Register and then login to the site.
You can create a new event http://mydevel.technikh.com/?q=node/add/event
(or) sign up for the existing event here http://mydevel.technikh.com/?q=node/10

After signing up check your email.

edward.peters’s picture

I tried this and it works brilliantly. Thanks so much for doing this. How can I get it working on my own site?

ln282’s picture

I tried your demo, and when I clicked on the ical file attached to the confirmation email, I got the following error message: "This calendar file is unreadable". I have a mac, maybe that's why it works for others but not for me?

Thanks for working on this-- it would be an awesome addition to signup.

technikh’s picture

I fixed it. Now it's working in Mac too.

vitalie’s picture

Version: 5.x-2.4 » 6.x-1.0-rc6
StatusFileSize
new6.36 KB

Hi, here is an add-on module that attaches the iCal file to the Signup confirmation message. I coded it for edward.peters, a good
friend of mine. We wanted to make it meet the general use-case (based on CCK date field), but with the number of hours put in, it still requires php/icalendar knowledge if it wants to meet special cases. The README.txt file describes it in more details.

If you have any ideas how to improve it, please let me know.

PS: Recently Edward realized that one may want to download an iCal file for an event without necessarily signing up for it. Sometime next week I will post another solution for this, that takes this into account.

vitalie’s picture

StatusFileSize
new13.61 KB

Hi again. So here is the iCal file module. It allows one to download an iCal version of an event node (a node with a CCK Date field). It also contains a Signup iCal Attach module. Both of these replace the functionality in my previous post and I think this one is better. It also offers one to configure the iCal template through a view (an idea I took from the Calendar module suite).

magnus’s picture

Version: 6.x-1.0-rc6 » 6.x-1.x-dev
Status: Active » Needs review
StatusFileSize
new15.34 KB

Vitalie: Thanks for your addon. Works really great!
I made som small changes:

In ical_file\ical_file.info I removed the line "package = Other" (doesn't belong there and the module will be placed among the "Other" modules anyway).

In ical_file\modules\signup_ical_attach\README.txt the last sentence was misspelled.

In ical_file\views\ical_file.views_default.inc I made some strings translatable on row 16, 23 and 89.
I updated the POT ical_file\translations to include the new strings.

And I have added the Swedish translations.

Anonymous’s picture

Hey, this is a really great addition thanks!

I am having a problem where the built in tokens are not working specifically:

DTSTAMP:%node-ical-dtstamp
DTSTART:%node-ical-dtstart
DTEND:%node-ical-dtend
%node-ical-rrule

When downloaded, the tokens are never replaced in the ical file.

magnus’s picture

Try Token module and use your own tokens instead. In my configuration I have it set up like this:
DTSTART:[field_time-datetime] <-- a token for a datetime field
DTEND:[field_time-to-datetime]
LOCATION: [field_location-raw] <-- a token for a location field
%node-ical-rrule

Anonymous’s picture

I get dates in this format when using the tokens [field_date-datetime]

DTSTART:2010-03-02T12:00:00
DTEND:2010-03-02T12:00:00

Which isn't readable by iCal (on macs).

If I build it individually piece by piece I can get the dates okay, but the time token still outputs in the format hours:minutes which is unusable by iCal.

For the time being, i added a custom token in the date_token.inc which includes an hour format without the colon :
From there I can use the custom template to properly format an ical date string from datetime tokens.

ln282’s picture

Thanks for the ical_file module! Once you have the download link for an event, you can programmatically add a button to let people add the event to their google calendar with this code:
<a href="http://www.google.com/calendar/render?cid=http://YOURSITE.com/node/<?php print $node->nid ?>/ical" target="_blank"><img src="http://www.google.com/calendar/images/ext/gc_button6.gif" border=0></a>

Just replace the "YOURSITE.com" with your url, and paste it into your template.

This is based on the code I found here: http://www.google.com/googlecalendar/event_publisher_guide.html There are other buttons if you'd prefer something else.

magnus’s picture

Status: Needs review » Reviewed & tested by the community
paoloteo’s picture

First of all thank you for the great module.
I need a small support to understand what I did wrong because when I receive the email (tested on Gmail) with the .ics attached I get something like this. How can I get it fixed ?

--------------5bd509d844410f916d554151fff51aaf
Content-Type: text/plain; charset=UTF-8; format=flowed; delsp=yes
Content-Transfer-Encoding: 8bit

Dear abby,

This email confirms that you have signed up for the event 'Test Con Call'.

Additional information on this event is at:
http://cee.smbapps.com/content/test-con-call

Sincerely,
CEE Forum

--------------5bd509d844410f916d554151fff51aaf
Content-Type: text/calendar; name="event.ics"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="event.ics"

QkVHSU46VkNBTEVOREFSDQpQUk9ESUQ6LS8vRHJ1cGFsLy9pQ2FsIGZpbGUvL0VODQpWRVJTSU9O
OjIuMA0KTUVUSE9EOlBVQkxJU0gNCkJFR0lOOlZFVkVOVA0KVUlEOjk3OGQ3NjY3NmY1ZTc5MThm
ODFkMjhlN2QwOTJjYTBkLTIwOTktYzY4Yjk0MjEyNDAwOTkzNTUyMjg5MjUwNmUzOTQzMzANCkRU
U1RBTVA6MjAxMDA3MDhUMDU1NjU0Wg0KRFRTVEFSVDoyMDEwMDcyMFQwOTAwMDANCkRURU5EOjIw
MTAwNzIwVDA5MDAwMApTVU1NQVJZOiV0aXRsZQ0KREVTQ1JJUFRJT046PHA+Qm9keSBvZiB0aGUg
dGVzdCBjb24gY2FsbDwvcD4NClVSTDpodHRwOi8vY2VlLnNtYmFwcHMuY29tL25vZGUvMjA5OQ0K
Q1JFQVRFRDoyMDEwMDcwN1QxOTM1MjZaDQpMQVNULU1PRElGSUVEOjIwMTAwNzA3VDIxMTIxMloN
CkVORDpWRVZFTlQNCkVORDpWQ0FMRU5EQVI=

--------------5bd509d844410f916d554151fff51aaf--

socialnicheguru’s picture

#20, I was getting the wrong date too. I was using the views option. When I checked the custom option for my content type and modified the following variables it worked for me on ical on a mac

DTSTART:%node-ical-field_date_event-dtstart
DTEND:%node-ical-field_date_event-dtend

socialnicheguru’s picture

Will this be a new module. For those of us not using calendar, this is a great module.

Feature request (since there is not another place for it)
Also, I would like t permission for users to be able to view/user the download ical link.

vitalie’s picture

StatusFileSize
new15.65 KB

I am sorry I disappeared.

Thank you Magnus for your corrections in #17. I found that I too corrected at least a bug (I had a hard-coded field name in theme.inc) in the meantime and so I have reproduced your corrections in my latest version and now I attach it.

I do not know what went wrong in #18 and #23, since my tests just now worked as expected. If you still need help here, let's start again. Let me know.

Possibly the bug I mentioned was responsible for the wrong dates of #24. Just to remark that %node-ical-dtstart variable takes the value of the first date field in the content type. If you have one field only, it should be the same as %node-ical-field_date_event-dtstart (your field is named field_date). I needed it (%node-ical-dtstart) for the Default option for the template provided by the module.

The attached version includes the feature of #25. I do not know how to register a module on this site. Will try to do it these days.

mstef’s picture

Recommend using the iCalcreator PHP class to generate the iCal: http://www.kigkonsult.se/iCalcreator/

I'll check out the ical_file module. I have the ical created already via that class. It helps doing it myself for my scenario because I have a lot of other data I want attached to the ical. My only problem remaining is how to attach it to an outgoing drupal mail.

vitalie’s picture

Thanks for this link. Yes it looks like that class could help one deal with the peculiarities of ical. Do let me know what you think about ica_file module, since it focuses more on simple ical versions of an event node (node with a date field) in Drupal. You can also see how it attaches an ical file to a message sent by Signup module in the signup_ical_attach contained in that archive (in the modules folder).

jvieille’s picture

Subscribe
Very interested in this feature

TJEngel’s picture

I have this add-on module working quite nicely, with a minor exception. I was having the issue mentioned in #24, where the email header was not correctly parsed and was appearing in the body of the email and prohibiting the attachment of the ical .ics file.

I started playing around with various email settings, and I think I've determined that I am unable to send an HTML email with the .ics file attachment. I can send Plain Text only, and the attachment sends just fine. But whenever I try to send an HTML body with the attachment, the header info displays in the email body.

dribblecastle’s picture

Firstly, thanks to vitalie & edward.peters. Both of these add on modules are exactly what I need. However, I'm having trouble getting the ical attach module to work.

Everything appears to install correctly. The GUI elements appear in the signup settings and the table modifications have been made. When I try to use the default(ical values) settings I get the message "message body empty" on a white screen right after I hit the signup button and the confirmation email with ical attachment does not send. The recent log entries in drupal show a generic mail and smtp error along with a php error with the following message.

Cannot modify header information - headers already sent by (output started at /var/www/sites/all/modules/smtp/phpmailer/class.phpmailer.php:586) in /var/www/includes/common.inc on line 345.

Of course, everything with the signup email works fine if I uncheck the iCal attachment option in the signup settings of the event.

I'm just getting started with drupal and php so I'm not sure what to investigate first. Can anyone lend a few ideas of what to do?

Here are some details of my server

Drupal 6.16
PHP 5.2.6-2ubuntu4.6
PHP memory limit 256M
PHPMailer library 5.1
Upload progress Not enabled
Your server is capable of displaying file upload progress, but does not have the required libraries. It is recommended to install the PECL uploadprogress library (preferred) or to install APC.
Web server Apache/2.2.9 (Ubuntu) PHP/5.2.6-2ubuntu4.6 with Suhosin-Patch

dribblecastle’s picture

FYI. My problem ended up not being related to this module or add on. It was a simple SMTP / PHP Mailer issue with authentication.

danepowell’s picture

Thanks for the awesome module. I've added another submodule that integrates with Open Atrium event notifications (although it should work with the Notifications/Messaging stack in general, not just in the context of Open Atrium). I really think that ical_file should be made a full project on drupal.org, and the submodules broken out and included with Signup and OA, respectively. I'm happy to help with this.