Answers.Body: <p>Indeed, seems to be an issue with the reminder trying to read the "for surveypal"... </p>
  
  <p>So you need to "escape" the { } that you want to keep for the end result so they aren't processed by civi and wrongly identified as token.</p>
  
  <p>I think we are using smarty to process the token for the reminders, you can try putting {ldelim} instead of "{" and {rdelim} instead of "}". </p>
  
  <p>Could you try if it works using scheduled reminder?</p>
  
  <p>Unfortunately, civicrm has different ways of parsing the token using different tools (smarty is one way), so you might have one working for "normal" mails and that won't work on another part (reminders), and the workaround is potentially specific for each of these, so it makes the testing a bit more complicated than "just" sending an email.</p>
  
  <p>X+</p>
  
  <p>P.S. It's probably not as user friendly as surveypal, but you can quickly get something working with webform and webform_civicrm to make simple surveys directly integrated in your site, including being able to store the response as an activity of the contact.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-10-14T20:06:10.960Z
Answers.Text: Thanks, Xavier. Indeed that worked using this {ldelim} - so many thanks!
Answers.UserDisplayName: Ilja De Coster
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-10-14T09:40:18.827Z
Answers.LastActivityDate: 2015-10-14T09:40:18.827Z
Answers.UserDisplayName: Xavier
Answers.Body: <p>I think the bulk mail changes URL automatically to be a redirect, so that you could track mail click on URL.</p>
  
  <p>You could achieve what you want by triggering CiviRules (together with the Email API) to send the same email, but as a transactional (single) email instead.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-10-14T20:10:06.777Z
Answers.Text: indeed, with civiRules and the API a lot more could be done (that is why I helped developing  civiRules...). But my trail was actually a quick solution do start something really quickly whil still testing and builing bigger stuff with civiRules and the API
Answers.UserDisplayName: Ilja De Coster
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-10-14T18:10:48.300Z
Answers.LastActivityDate: 2015-10-14T18:10:48.300Z
Answers.UserDisplayName: Flying
Body: <p>I’m doing a basic automation with scheduled reminders: I want to send a survey to every one where a certain activity is completed.
  For the survey I use a nice third party app: surveypal.com. As I want to personalise the survey, I need personal data from civi to surveypal to identify the response.</p>
  
  <p>Surveypal has nice documentation on how to do this. The url send to a potential respondent should look like:</p>
  
  <p><code>https://my.surveypal.com/app/form/ext?_d=0&amp;_sid=261570634&amp;_k=2kpdVu0Y20GKuXoMnpsCYQ6c43g82T4PWT29J4Kj5TFRIBltoKRMpAng0p
  iVLOtX&amp;externalId=[ID]&amp;meta=[{"key":"Gender","value":"Male"},{"key":"Age","value":"15"}]</code></p>
  
  <p>where sid and k are the id’s of the survey in surveypal, externalID could be the contact_id from civi and the data in meta data could be other civi fields.</p>
  
  <p>Building a message template in civimail, including some tokens for the personal data, this url so becomes:</p>
  
  <p><code>https://my.surveypal.com/app/form/ext?_d=0&amp;_sid=xxx&amp;_k=xxxxx&amp;externalid=[{contact.contact_id}]&amp;meta=[{"key":"email","value":"{contact.email}"},{"key":"SRdonorcontactid","value":"{contact.contact_id}"},{"key":"firstname","value":"{contact.first_name}"},{"key":"lastname","value":"{contact.last_name}"},{"key":"Aanspreking","value":"{contact.addressee}"}]</code></p>
  
  <p>When sending manually this message template using an individual email (activity -> send an email). This works perfect. Civi does send an email to the particular contact, and the person gets a nice link, participates the survey in surveypal and I have all the response data I need.</p>
  
  <p>But, when I use this same message template to set a scheduled reminder link to an activity, then the email is send automatically correctly, but the url is changed towards something like <code>&amp;meta:[,,,,,,]</code> So no personal data is transferred. The potential respondent gets an error message when clicking the url that the url does not exist.</p>
  
  <p>Any idea’s: what happened, what is wrong?
  I’m afraid it has something to do with the {} used for tokens in civimail, while used to group data in the surveypal-url.</p>
  
Tags: <email><message-templates><smarty>
Title: Mail not working url for third party app
ThreadText: # Mail not working url for third party app
  
  (Asked by: username_0 on 2015-10-14)
  
  I’m doing a basic automation with scheduled reminders: I want to send a survey to every one where a certain activity is completed.
  For the survey I use a nice third party app: surveypal.com. As I want to personalise the survey, I need personal data from civi to surveypal to identify the response.
  
  Surveypal has nice documentation on how to do this. The url send to a potential respondent should look like:
  
  `https://my.surveypal.com/app/form/ext?_d=0&_sid=261570634&_k=2kpdVu0Y20GKuXoMnpsCYQ6c43g82T4PWT29J4Kj5TFRIBltoKRMpAng0p
  iVLOtX&externalId=[ID]&meta=[{"key":"Gender","value":"Male"},{"key":"Age","value":"15"}]`
  
  where sid and k are the id’s of the survey in surveypal, externalID could be the contact\_id from civi and the data in meta data could be other civi fields.
  
  Building a message template in civimail, including some tokens for the personal data, this url so becomes:
  
  `https://my.surveypal.com/app/form/ext?_d=0&_sid=xxx&_k=xxxxx&externalid=[{contact.contact_id}]&meta=[{"key":"email","value":"{contact.email}"},{"key":"SRdonorcontactid","value":"{contact.contact_id}"},{"key":"firstname","value":"{contact.first_name}"},{"key":"lastname","value":"{contact.last_name}"},{"key":"Aanspreking","value":"{contact.addressee}"}]`
  
  When sending manually this message template using an individual email (activity -> send an email). This works perfect. Civi does send an email to the particular contact, and the person gets a nice link, participates the survey in surveypal and I have all the response data I need.
  
  But, when I use this same message template to set a scheduled reminder link to an activity, then the email is send automatically correctly, but the url is changed towards something like `&meta:[,,,,,,]` So no personal data is transferred. The potential respondent gets an error message when clicking the url that the url does not exist.
  
  Any idea’s: what happened, what is wrong?
  I’m afraid it has something to do with the {} used for tokens in civimail, while used to group data in the surveypal-url.
  
  **Tags:** email, message-templates, smarty
  
  
  ---
  
  ## 2 answers
  
  ### Answer by username_1 on 2015-10-14. Score: 0 | Accepted answer
  
  Indeed, seems to be an issue with the reminder trying to read the "for surveypal"...
  
  So you need to "escape" the { } that you want to keep for the end result so they aren't processed by civi and wrongly identified as token.
  
  I think we are using smarty to process the token for the reminders, you can try putting {ldelim} instead of "{" and {rdelim} instead of "}".
  
  Could you try if it works using scheduled reminder?
  
  Unfortunately, civicrm has different ways of parsing the token using different tools (smarty is one way), so you might have one working for "normal" mails and that won't work on another part (reminders), and the workaround is potentially specific for each of these, so it makes the testing a bit more complicated than "just" sending an email.
  
  X+
  
  P.S. It's probably not as user friendly as surveypal, but you can quickly get something working with webform and webform\_civicrm to make simple surveys directly integrated in your site, including being able to store the response as an activity of the contact.
  
  > **Comments:**
  > **username_0**: Thanks, username_1. Indeed that worked using this {ldelim} - so many thanks!  
  
  ---
  
  ### Answer by username_2 on 2015-10-14. Score: 0
  
  I think the bulk mail changes URL automatically to be a redirect, so that you could track mail click on URL.
  
  You could achieve what you want by triggering CiviRules (together with the Email API) to send the same email, but as a transactional (single) email instead.
  
  > **Comments:**
  > **username_0**: indeed, with civiRules and the API a lot more could be done (that is why I helped developing  civiRules...). But my trail was actually a quick solution do start something really quickly whil still testing and builing bigger stuff with civiRules and the API  
  
  ---
  
  