Skip to main content
added 261 characters in body; edited title
Source Link
Duncan Stewart
  • 723
  • 1
  • 8
  • 20

I'm trying to add a link (to a webinar) in a Calendar invite attached to an email

Similar to whatStarting with Doug Ayers' did hereVisualforce solution (thank you, Doug!) (https://douglascayers.com/2015/01/09/salesforce-send-calendar-invites-in-visualforce-email-templates/). I, I create the invite as a String and then attach it to the email, which seems to be working well for capturing most of the date & timeevent details, but I would like to include a link in the description, as this particular project is about webinar registrations. The 'DESCRIPTION:' field/node is not a fan of HTML, apparently, and drops everything after the first suggestion of a tag. How can I make it work?

Here's the code for the text string:

    public static String createCalendarInvite_EST(String organizerEmail, String slabel, DateTime startDT, DateTime endDT, String summary, String description) {
    
    String newLine = '\n';
    String result = 'BEGIN:VCALENDAR';
    result += newLine + 'METHOD:PUBLISH';
    result += newLine + 'VERSION:2.0';
    result += newLine + 'PRODID::-//hacksw/handcal//NONSGML v1.0//EN';
    result += newLine + 'BEGIN:VEVENT';
    result += newLine + 'ORGANIZER:mailto:' + organizerEmail;
    result += newLine + 'DTSTAMP;TZID=America/New_York:' + startDt.format('yyyyMMdd') + 'T' + startDt.format('yyyyMMddHHmmssZ').right(11).left(6);
    result += newLine + 'UID:' + slabel;
    result += newLine + 'DTSTART;TZID=America/New_York:' + startDt.format('yyyyMMdd') + 'T' + startDt.format('yyyyMMddHHmmssZ').right(11).left(6);
    result += newLine + 'DTEND;TZID=America/New_York:' + endDT.format('yyyyMMdd') + 'T' + endDT.format('yyyyMMddHHmmssZ').right(11).left(6);
    result += newLine + 'SUMMARY:' + summary;
    result += newLine + 'DESCRIPTION:' +    description;
    result += newLine + 'BEGIN:VALARM';
    result += newLine + 'TRIGGER:-PT1D';
    result += newLine + 'ACTION:DISPLAY';
    result += newLine + 'DESCRIPTION:Reminder';
    result += newLine + 'END:VALARM';
    result += newLine + 'END:VEVENT';
    result += newLine + 'END:VCALENDAR';
    
    return result;
    
}

(I've hard-coded the date/time as EST; GMT was resulting in a disconnect between the values as they appeared in the email body and the calendar entry, and I took a hammer to it. I'll revisit that another time ...)

I see where adding the email address after 'ORGANIZER:mailto:' works cleanly; does anyone have experience creating links in a related way?

I'm trying to add a link (to a webinar) in a Calendar invite

Similar to what Doug Ayers' did here (https://douglascayers.com/2015/01/09/salesforce-send-calendar-invites-in-visualforce-email-templates/). I create the invite as a String and then attach it, which seems to be working well for capturing the date & time, but I would like to include a link in the description. The 'DESCRIPTION:' field/node is not a fan of HTML, apparently. How can I make it work?

Here's the code for the text string:

    public static String createCalendarInvite_EST(String organizerEmail, String slabel, DateTime startDT, DateTime endDT, String summary, String description) {
    
    String newLine = '\n';
    String result = 'BEGIN:VCALENDAR';
    result += newLine + 'METHOD:PUBLISH';
    result += newLine + 'VERSION:2.0';
    result += newLine + 'PRODID::-//hacksw/handcal//NONSGML v1.0//EN';
    result += newLine + 'BEGIN:VEVENT';
    result += newLine + 'ORGANIZER:mailto:' + organizerEmail;
    result += newLine + 'DTSTAMP;TZID=America/New_York:' + startDt.format('yyyyMMdd') + 'T' + startDt.format('yyyyMMddHHmmssZ').right(11).left(6);
    result += newLine + 'UID:' + slabel;
    result += newLine + 'DTSTART;TZID=America/New_York:' + startDt.format('yyyyMMdd') + 'T' + startDt.format('yyyyMMddHHmmssZ').right(11).left(6);
    result += newLine + 'DTEND;TZID=America/New_York:' + endDT.format('yyyyMMdd') + 'T' + endDT.format('yyyyMMddHHmmssZ').right(11).left(6);
    result += newLine + 'SUMMARY:' + summary;
    result += newLine + 'DESCRIPTION:' +    description;
    result += newLine + 'BEGIN:VALARM';
    result += newLine + 'TRIGGER:-PT1D';
    result += newLine + 'ACTION:DISPLAY';
    result += newLine + 'DESCRIPTION:Reminder';
    result += newLine + 'END:VALARM';
    result += newLine + 'END:VEVENT';
    result += newLine + 'END:VCALENDAR';
    
    return result;
    
}

(I've hard-coded the date/time as EST; GMT was resulting in a disconnect between the values as they appeared in the email body and the calendar entry, and I took a hammer to it. I'll revisit that another time ...)

I'm trying to add a link (to a webinar) in a Calendar invite attached to an email

Starting with Doug Ayers' Visualforce solution (thank you, Doug!) (https://douglascayers.com/2015/01/09/salesforce-send-calendar-invites-in-visualforce-email-templates/), I create the invite as a String and attach it to the email, which seems to be working well for capturing most of the event details, but I would like to include a link in the description, as this particular project is about webinar registrations. The 'DESCRIPTION:' field/node is not a fan of HTML, apparently, and drops everything after the first suggestion of a tag.

Here's the code for the text string:

    public static String createCalendarInvite_EST(String organizerEmail, String slabel, DateTime startDT, DateTime endDT, String summary, String description) {
    
    String newLine = '\n';
    String result = 'BEGIN:VCALENDAR';
    result += newLine + 'METHOD:PUBLISH';
    result += newLine + 'VERSION:2.0';
    result += newLine + 'PRODID::-//hacksw/handcal//NONSGML v1.0//EN';
    result += newLine + 'BEGIN:VEVENT';
    result += newLine + 'ORGANIZER:mailto:' + organizerEmail;
    result += newLine + 'DTSTAMP;TZID=America/New_York:' + startDt.format('yyyyMMdd') + 'T' + startDt.format('yyyyMMddHHmmssZ').right(11).left(6);
    result += newLine + 'UID:' + slabel;
    result += newLine + 'DTSTART;TZID=America/New_York:' + startDt.format('yyyyMMdd') + 'T' + startDt.format('yyyyMMddHHmmssZ').right(11).left(6);
    result += newLine + 'DTEND;TZID=America/New_York:' + endDT.format('yyyyMMdd') + 'T' + endDT.format('yyyyMMddHHmmssZ').right(11).left(6);
    result += newLine + 'SUMMARY:' + summary;
    result += newLine + 'DESCRIPTION:' +    description;
    result += newLine + 'BEGIN:VALARM';
    result += newLine + 'TRIGGER:-PT1D';
    result += newLine + 'ACTION:DISPLAY';
    result += newLine + 'DESCRIPTION:Reminder';
    result += newLine + 'END:VALARM';
    result += newLine + 'END:VEVENT';
    result += newLine + 'END:VCALENDAR';
    
    return result;
    
}

(I've hard-coded the date/time as EST; GMT was resulting in a disconnect between the values as they appeared in the email body and the calendar entry, and I took a hammer to it. I'll revisit that another time ...)

I see where adding the email address after 'ORGANIZER:mailto:' works cleanly; does anyone have experience creating links in a related way?

deleted 18 characters in body
Source Link
Adrian Larson
  • 151.4k
  • 38
  • 247
  • 431

Similar to what Doug Ayers' did here (https://douglascayers.com/2015/01/09/salesforce-send-calendar-invites-in-visualforce-email-templates/). I create the invite as a String and then attach it, which seems to be working well for capturing the date & time, but I would like to include a link in the description. The 'DESCRIPTION:' field/node is not a fan of HTML, apparently;apparently. How can anyone suggest a way toI make it work?

Here's the code for the text string:

    public static String createCalendarInvite_EST(String organizerEmail, String slabel, DateTime startDT, DateTime endDT, String summary, String description) {
    
    String newLine = '\n';
    String result = 'BEGIN:VCALENDAR';
    result += newLine + 'METHOD:PUBLISH';
    result += newLine + 'VERSION:2.0';
    result += newLine + 'PRODID::-//hacksw/handcal//NONSGML v1.0//EN';
    result += newLine + 'BEGIN:VEVENT';
    result += newLine + 'ORGANIZER:mailto:' + organizerEmail;
    result += newLine + 'DTSTAMP;TZID=America/New_York:' + startDt.format('yyyyMMdd') + 'T' + startDt.format('yyyyMMddHHmmssZ').right(11).left(6);
    result += newLine + 'UID:' + slabel;
    result += newLine + 'DTSTART;TZID=America/New_York:' + startDt.format('yyyyMMdd') + 'T' + startDt.format('yyyyMMddHHmmssZ').right(11).left(6);
    result += newLine + 'DTEND;TZID=America/New_York:' + endDT.format('yyyyMMdd') + 'T' + endDT.format('yyyyMMddHHmmssZ').right(11).left(6);
    result += newLine + 'SUMMARY:' + summary;
    result += newLine + 'DESCRIPTION:' +    description;
    result += newLine + 'BEGIN:VALARM';
    result += newLine + 'TRIGGER:-PT1D';
    result += newLine + 'ACTION:DISPLAY';
    result += newLine + 'DESCRIPTION:Reminder';
    result += newLine + 'END:VALARM';
    result += newLine + 'END:VEVENT';
    result += newLine + 'END:VCALENDAR';
    
    return result;
    
}

(I've hard-coded the date/time as EST; GMT was resulting in a disconnect between the values as they appeared in the email body and the calendar entry, and I took a hammer to it. I'll revisit that another time ...)

Similar to what Doug Ayers' did here (https://douglascayers.com/2015/01/09/salesforce-send-calendar-invites-in-visualforce-email-templates/). I create the invite as a String and then attach it, which seems to be working well for capturing the date & time, but I would like to include a link in the description. The 'DESCRIPTION:' field/node is not a fan of HTML, apparently; can anyone suggest a way to make it work?

Here's the code for the text string:

    public static String createCalendarInvite_EST(String organizerEmail, String slabel, DateTime startDT, DateTime endDT, String summary, String description) {
    
    String newLine = '\n';
    String result = 'BEGIN:VCALENDAR';
    result += newLine + 'METHOD:PUBLISH';
    result += newLine + 'VERSION:2.0';
    result += newLine + 'PRODID::-//hacksw/handcal//NONSGML v1.0//EN';
    result += newLine + 'BEGIN:VEVENT';
    result += newLine + 'ORGANIZER:mailto:' + organizerEmail;
    result += newLine + 'DTSTAMP;TZID=America/New_York:' + startDt.format('yyyyMMdd') + 'T' + startDt.format('yyyyMMddHHmmssZ').right(11).left(6);
    result += newLine + 'UID:' + slabel;
    result += newLine + 'DTSTART;TZID=America/New_York:' + startDt.format('yyyyMMdd') + 'T' + startDt.format('yyyyMMddHHmmssZ').right(11).left(6);
    result += newLine + 'DTEND;TZID=America/New_York:' + endDT.format('yyyyMMdd') + 'T' + endDT.format('yyyyMMddHHmmssZ').right(11).left(6);
    result += newLine + 'SUMMARY:' + summary;
    result += newLine + 'DESCRIPTION:' +    description;
    result += newLine + 'BEGIN:VALARM';
    result += newLine + 'TRIGGER:-PT1D';
    result += newLine + 'ACTION:DISPLAY';
    result += newLine + 'DESCRIPTION:Reminder';
    result += newLine + 'END:VALARM';
    result += newLine + 'END:VEVENT';
    result += newLine + 'END:VCALENDAR';
    
    return result;
    
}

(I've hard-coded the date/time as EST; GMT was resulting in a disconnect between the values as they appeared in the email body and the calendar entry, and I took a hammer to it. I'll revisit that another time ...)

Similar to what Doug Ayers' did here (https://douglascayers.com/2015/01/09/salesforce-send-calendar-invites-in-visualforce-email-templates/). I create the invite as a String and then attach it, which seems to be working well for capturing the date & time, but I would like to include a link in the description. The 'DESCRIPTION:' field/node is not a fan of HTML, apparently. How can I make it work?

Here's the code for the text string:

    public static String createCalendarInvite_EST(String organizerEmail, String slabel, DateTime startDT, DateTime endDT, String summary, String description) {
    
    String newLine = '\n';
    String result = 'BEGIN:VCALENDAR';
    result += newLine + 'METHOD:PUBLISH';
    result += newLine + 'VERSION:2.0';
    result += newLine + 'PRODID::-//hacksw/handcal//NONSGML v1.0//EN';
    result += newLine + 'BEGIN:VEVENT';
    result += newLine + 'ORGANIZER:mailto:' + organizerEmail;
    result += newLine + 'DTSTAMP;TZID=America/New_York:' + startDt.format('yyyyMMdd') + 'T' + startDt.format('yyyyMMddHHmmssZ').right(11).left(6);
    result += newLine + 'UID:' + slabel;
    result += newLine + 'DTSTART;TZID=America/New_York:' + startDt.format('yyyyMMdd') + 'T' + startDt.format('yyyyMMddHHmmssZ').right(11).left(6);
    result += newLine + 'DTEND;TZID=America/New_York:' + endDT.format('yyyyMMdd') + 'T' + endDT.format('yyyyMMddHHmmssZ').right(11).left(6);
    result += newLine + 'SUMMARY:' + summary;
    result += newLine + 'DESCRIPTION:' +    description;
    result += newLine + 'BEGIN:VALARM';
    result += newLine + 'TRIGGER:-PT1D';
    result += newLine + 'ACTION:DISPLAY';
    result += newLine + 'DESCRIPTION:Reminder';
    result += newLine + 'END:VALARM';
    result += newLine + 'END:VEVENT';
    result += newLine + 'END:VCALENDAR';
    
    return result;
    
}

(I've hard-coded the date/time as EST; GMT was resulting in a disconnect between the values as they appeared in the email body and the calendar entry, and I took a hammer to it. I'll revisit that another time ...)

Source Link
Duncan Stewart
  • 723
  • 1
  • 8
  • 20

I'm trying to add a link (to a webinar) in a Calendar invite

Similar to what Doug Ayers' did here (https://douglascayers.com/2015/01/09/salesforce-send-calendar-invites-in-visualforce-email-templates/). I create the invite as a String and then attach it, which seems to be working well for capturing the date & time, but I would like to include a link in the description. The 'DESCRIPTION:' field/node is not a fan of HTML, apparently; can anyone suggest a way to make it work?

Here's the code for the text string:

    public static String createCalendarInvite_EST(String organizerEmail, String slabel, DateTime startDT, DateTime endDT, String summary, String description) {
    
    String newLine = '\n';
    String result = 'BEGIN:VCALENDAR';
    result += newLine + 'METHOD:PUBLISH';
    result += newLine + 'VERSION:2.0';
    result += newLine + 'PRODID::-//hacksw/handcal//NONSGML v1.0//EN';
    result += newLine + 'BEGIN:VEVENT';
    result += newLine + 'ORGANIZER:mailto:' + organizerEmail;
    result += newLine + 'DTSTAMP;TZID=America/New_York:' + startDt.format('yyyyMMdd') + 'T' + startDt.format('yyyyMMddHHmmssZ').right(11).left(6);
    result += newLine + 'UID:' + slabel;
    result += newLine + 'DTSTART;TZID=America/New_York:' + startDt.format('yyyyMMdd') + 'T' + startDt.format('yyyyMMddHHmmssZ').right(11).left(6);
    result += newLine + 'DTEND;TZID=America/New_York:' + endDT.format('yyyyMMdd') + 'T' + endDT.format('yyyyMMddHHmmssZ').right(11).left(6);
    result += newLine + 'SUMMARY:' + summary;
    result += newLine + 'DESCRIPTION:' +    description;
    result += newLine + 'BEGIN:VALARM';
    result += newLine + 'TRIGGER:-PT1D';
    result += newLine + 'ACTION:DISPLAY';
    result += newLine + 'DESCRIPTION:Reminder';
    result += newLine + 'END:VALARM';
    result += newLine + 'END:VEVENT';
    result += newLine + 'END:VCALENDAR';
    
    return result;
    
}

(I've hard-coded the date/time as EST; GMT was resulting in a disconnect between the values as they appeared in the email body and the calendar entry, and I took a hammer to it. I'll revisit that another time ...)