Record URL in BPM Process email templates for clickable images?

Hello Sugar lovers!

I'm trying to pimp my customer's email reminders by using images. I'd like to make some of them clickable and send the user to the record page. The use case is a reminder to provide a meeting report. 

The issue is that the tag I'm using is transformed upon save and is therefore not interpreted. 

For instance: 

<a href="{::href_link::Meetings::name::}"><img src="myurl"></a>

Is transformed to: 

<a href="%7B%3A%3Ahref_link%3A%3AMeetings%3A%3Aname%3A%3A%7D"><img src"myurl)></a>

Which of course is not interpreded and is rendered as is. 

Am I using the wrong tag? Your help will be much appreciated!

Cheers,
Damien

  • Added note: we are on Sugar Sell 12.3 on our way to 13.0 ;) 

    Damien Pochon

    CRM & Digital consultant @ ITS4U Group

  • Hi ,

    The variable you are seeking to use would not work even if the variable was not encoded on saving the template. This variable explicitly prints out the record name with a hyperlink to the record rather than just being the raw URL.

    With that said, even if I select an explicit URL field (e.g. the Website field on Accounts) to be the variable for your use case, the variable string still gets encoded as you observed and that does not translate to a hyperlink in the resulting email. That seems like it should be treated as a bug and I recommend filing a case with Sugar. 

    Chris

  • 2 years... maybe better late than never? Nerd

    I managed to now get a dynamic printer image which is also a hyperlink into our registration email confirmation emails.

    I think the trick is in using a text field, not url! Use url if you want a link in your Sugar record, but for PDef emails it won't work...
    ..and the last half being your field. I'll show you mine below. 


    DYNAMIC IMAGE

    In the Process Definition Email Template the Image Source is a combination of:

    • some externally stored image, ours is a google cloud storage url - the first part that won't change:
      storage.googleapis.com/

    • and the second part is our field, in my case a related Text field. 
      {::p_product_g_registration_1::product_class_external_image_c::}

      In our product module this text field actually contains the remainder of the specific public url for that products cloud storage image.  (Also you'll need to add that into template with the Fields Selector, copy & delete it - then paste into the image source)

    • giving the full url:

      storage.googleapis.com/{::p_product_g_registration_1::product_class_external_image_c::}

      Of course in the template the image (correctly) won't work at all - but it will work when you send a live email via your Process Definition.
      Tip: set up seperate PDef for one specific record, allowing you to test without using live records, and sending to yourself.


    IMAGE AS A LINK

    Same theory again for making the image a hyperlink in the URL field:

    url/{::sugarField::}


    IMAGE AS A LINK BACK TO THE SUGAR RECORD

    You can also use the same again for linking back to a specific sugar record, but additional butchery is required as you cant just stick the record ID in... as noted above it will format it upon saving.

    Do this instead:

    yourSugarInstanceURL/[::module::id::]

    For example in my case: {::g_Registration::id::}
    *note, for some reason ID is not available via field selector, so grab any field and change it to id

    mycrm.sugarcloud.uk/{::g_Registration::id::}

    to land me back in
    https://mycrm.sugarcloud.uk/#g_Registration/2d4ca550-e7ec-11ec-a63a-06f9654bc8a2


    Hope thats is helpful Slight smile