Expand my Community achievements bar.

Announcing the launch of new sub-community for Campaign Web UI to cater specifically to the needs of Campaign Web UI users!
SOLVED

Typology Rule not pulling Recipient.id to Personalise a WebApp URL

Avatar

Level 2

Hello Adobe Campaign Community,

I am hoping someone from the Adobe Campaign Community might be able to help with bizzar issue I am facing.

Let me try explain the issue.

 

What I am trying to do:

For One-Click Unsubscribe (Gmail and Yahoo requirement) I am building a typology rule which will add SMTP header to all new email deliveries.

Adobe provided Typology rule code for MailTo SMTP header, but I am changing bit of code to include Recipient’s EncryptedID (Or ID) to the URL so when a user clicks on the Unsubscribe link on Gmail, the URL has recipient’s ID which we can use to identify the recipient and unsubscribe them.

The change I have added to the Typology rule is that I am checking if “delivery.mapping.schema” is equal to “nms:recipient”. If so, I am building headerUnsubUrl with recipient encryptedID to be passed in SMTP header. Else I am passing only MailTo SMTP header. In below example I am using recipient.id as it is also giving me same error. The code is like this:

var deliveryMappingSchema = delivery.mapping.schema;

logInfo("---Delivery Mapping Schema is: " + deliveryMappingSchema);

 

if (deliveryMappingSchema == "nms:recipient"){ 

  logInfo("Mapping Schema of this delivery is nms:recipient");

  var headerUnsubUrl ="https://yourdomain.com/webApp/oneClickUnsub?id=<%= recipient.id%>>, <mailto:<%@ include option='NmsEmail_DefaultErrorAddr' %>?subject=unsubscribe<%= escape(message.mimeMessageId) %>";

else {

  logInfo("Mapping Schema of this delivery is Unknown");

var headerUnsubUrl ="mailto:<%@ include option='NmsEmail_DefaultErrorAddr' %>?subject=unsubscribe<%= escape(message.mimeMessageId) %>";

}

 

What is the Issue:

All is working fine in UAT. When I send email to Gmail, I see Unsubscribe link and I am able to unsubscribe using the link. The link has recipient.id which was passed by the Typology rule.


The issue I am facing for Client A is when I am moving Typology code into Prod Instance. When I create a new recipient delivery with amended Typology rule (which is working fine in UAT), the delivery is failing with error:

Error while compiling script 'SMTP headers' line 4: recipient is not defined. SCR-160012 Javascript&colon; error while evaluating script 'SMTP headers'.

 

Some reason it is not recognising the recipient schema, hence not passing recipient.id. Same error is happening if I use custom schema too.

 

I tried same solution on another Client’s Prod instance (Client B), although it is creating the delivery (No error like above) and email is going out, but some reason the id is “undefined” in SMTP header of the email I received.

https://yourdomain.co.uk/webApp/oneClickUnsub?id=undefined

 

 

Has anyone seen this issue?
The marketing instances are hosted by Client (Not Adobe). Architecture wise both are same for Client A where email is failing with an error.

For Client B, the only difference between UAT and Prod I can see is that the “Publication Option for Web forms and surveys” is Local on UAT (Deployment Wizard > Access from Internet configuration), but in Prod the publication mode is setup to be “Other Adobe Campaign Server(s)”, but the setup of "Internal URLs of frontal server" is the Adobe Campaign Web Server.

 

Can someone suggest why I am facing issue on Prod only and not on the UAT? What I can check/change on Prod Adobe servers to make it work?

Any other suggestions are also welcome. E.g. how you created solution for One-click Unsub using Adobe based WebApp.

 

 

Thank you so much for your help

Nagender

Topics

Topics help categorize Community content and increase your ability to discover relevant content.

1 Accepted Solution

Avatar

Correct answer by
Level 2

Hi All,

 

I found the cause of the issue.
The issue was not with the Code (As it was working fine), but setting of "Phase" (Within General Tab of Typology Rule). For MailTo SMTP header, it was set to "At the Start of the Prisonization", but since I am now pulling attributes from schema, it needed to be "At the start of targeting".  Then naming are bit confusion and does give much explanation for one to read and understand how it will be applied.

 

I hope one day this article might help someone when dealing with Typology rules

 

 

Regards

Nagender

View solution in original post

5 Replies

Avatar

Level 2

To add one more finding.

If I directly put SMTP header (see below) in the delivery, it is working fine. The email I receive has the ID of the recipient.


List-Unsubscribe: <https://yourdomain.com/webApp/oneClickUnsub?id= <%= recipient.cryptedId%>>, <mailto:<%@ include option='NmsEmail_DefaultErrorAddr' %>?subject=unsubscribe<%= escape(message.mimeMessageId) %>> List-Unsubscribe-Post: List-Unsubscribe=One-Click

 

It means Typology rule is writing into SMTP header of the delivery, but when mid-source is sending email, it is not recognising the schema.

Regards

Nagender

Avatar

Community Advisor

Hello @nagendersingh80 

 

The code that you using in SMTP header and Typology is little different.

 

Change 

<%= recipient.id%>

to 

<%= recipient.cryptedId%>

 

In the code you are using in Typology rule


     Manoj
     Find me on LinkedIn

Hi Manoj,
Thank for your response. The issue is with any attribute I may pass. I have tried with OOTB attribute "id" as well as "cryptedId" and other attributes too. But none is working as the delivery is failing to recognise the Recipient Schema.

 

 

Kind regards

Nagender

Avatar

Correct answer by
Level 2

Hi All,

 

I found the cause of the issue.
The issue was not with the Code (As it was working fine), but setting of "Phase" (Within General Tab of Typology Rule). For MailTo SMTP header, it was set to "At the Start of the Prisonization", but since I am now pulling attributes from schema, it needed to be "At the start of targeting".  Then naming are bit confusion and does give much explanation for one to read and understand how it will be applied.

 

I hope one day this article might help someone when dealing with Typology rules

 

 

Regards

Nagender

Avatar

Level 1

Thanks JoinPD,

I found the issue. The issue was with setting of "Phase" (Within General Tab of Typology Rule). For MailTo SMTP header, it was set to "At the Start of the Prisonization", but since I am now pulling attributes from schema, it needed to be "At the start of targeting".  

Regards

Nagender