0

Custom Notification Token Issue - Critical

HI Team,

I am working on custom notification, but in notification, token values are available when user receive the notification,

Veeva SDK Code:

template.setTokenValue("docNumber", docName);
template.setTokenValue("expiration_date__c", exDate.toString());
template.setTokenValue("docStatus", docStatus);

Email Template :

${recipientName}, <br> <br> Document Number: ${docNumber}<br> Document Name: ${docName} <br> Document Status: ${docStatus} <br> Expiration Date: ${expiration_date__c}<br> "${docName}" is set to automatically expire on ${expiration_date__c}.

Could you please let me why it is not working?

Thanks and Regards,
Mithun soni

3 comments

  • Avatar
    Richard Pater

    Hi Mithun,

     

    A couple of things need to work together here.  Your email template should have tokens like this:

    ${Custom.docNumber}

     

    In your SDK code, you should have a line like this:

    template.setTokenValue("docNumber", docNumberValue);

     

    So based on your code sample, I think you need to update your email template to include the Custom prefix for your custom tokens.

    Something like this:

    Email Template :

    ${recipientName}, <br> <br> Document Number: ${Custom.docNumber}<br> Document Name: ${docName} <br> Document Status: ${Custom.docStatus} <br> Expiration Date: ${Custom.expiration_date__c}<br> "${docName}" is set to automatically expire on ${Custom.expiration_date__c}.

     

    I don't see that you are setting a value for docName, but if you are trying to use the default token, this will only work if your trigger is running in a context where that token is available.

     

    Thanks,

     

    Rich

  • Avatar
    Mithun Soni

    HI Richard,

     

    Thanks for your help! it worked.

    I have one more question, is there any way to set the document hyperlink  and vault link in custom email template?

     

    Thanks,

    Mithun Soni 

     

  • Avatar
    Sameer Mehta

    Hi Mithun,

     

     You should be able to use the ${link__sys} token to get the document url and ${uiBaseExtUrl} token to get the vault link. For more information regarding notification tokens, please refer to the documentation here: https://vaulthelp2.vod309.com/wordpress/troubleshooting/email-and-messages-administration/#document_message_tokens

     

    Best Regards,

    Sameer

Please sign in to leave a comment.