0

This may not be an SFMC problem at all, and more of a scripting issue. But I wanted to see if there was anything I could do from an SFMC side.

I'm using the below code to generate an event on a landing page. The page downloads the event and the event details are unique to each user and known beforehand. The cloud page is leveraging this script https://github.com/nwcell/ics.js to generage an ICS file. But when I open the file, the encoded portion isn't formatting in the event. Is this something I can format differently with my ampscript or is this something that needs to be addressed in the js on the landing page?

/* customizable fields */
Set @title = "This is the title of the event"
Set @description = "This%20is%20the%20description%20field.%20I'd%20like%20to%20pass%20a%20few%20values%20here.%20%0A%0AIncluding%20a%20bulleted%20list%3A%0A%0A%E2%80%A2%20bullet%201%0A%E2%80%A2%20bullet%202%0A%E2%80%A2%20bullet%203%0A%0AI'm%20not%20sure%20if%20this%20is%20possible."
Set @location = "This is the location of the event" 


/* system metadata */
Set @contentType = "Email"
Set @contentName = emailName_
Set @testFlag = "N"

Set @AddToCalURL = CloudPagesURL(4205,
                                 "title",@title,
                                 "description",@description,
                                 "location",@location,
                                 "startDate",@startDate,
                                 "endDate",@endDate,
                                 "contentType",@contentType,
                                 "contentName",@contentName,
                                 "SendJobId",@sendJobId,
                                 "ContactKey",@contactKey)
                                 
                                 
]%%

%%=RedirectTo(@AddToCalURL)=%%

1 Answer 1

2

I guess you're talking about the values not being decoded by ics.js, right?

You can call decodeURIComponent either from SFMC side (that's a SSJS function, though, so you'll need to change some things on your code) or just call the same function from front-end, right before generating the event.

Like this:

decodeURIComponent("This%20is%20the%20description%20field...")  // This is the description field...
1
  • Thank you! I also was able to add the line breaks with \\n that i needed. This was a weird one so i appreciate you looking into it.
    – en-rep
    Jul 28, 2023 at 1:16

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .