Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
BedrockMission!

Learn More

View all

Sign in to view all badges

Services and Subscription confirmation email not sending when record is added via Javascript

Avatar

Avatar
Validate 1
Level 1
AquaticAds
Level 1

Likes

0 likes

Total Posts

3 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
View profile

Avatar
Validate 1
Level 1
AquaticAds
Level 1

Likes

0 likes

Total Posts

3 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
View profile
AquaticAds
Level 1

05-11-2020

Hi there,

 

Wondered if you might be able to help? We have the below bit of JS that is supposed to add a record to the Recipient table, save it, extract the id, then in turn add the record to a Subscription list within Adobe Campaign Classic. The code works as expected, however for whatever reason, no Confirmation (Subscribed) email is being triggered and sent out. We have attached a 'Subscribed' email template (with Target Mapping set to nms:subscription ) however no email is still being sent. If however, we manually add an entry into the Subscription list, the email is sent to the recipients email address. Is there possibly some additional value we need to add to confirm that we would like to trigger the Confirmation email message to send?

 

Below is the current code:

 

// create a new recipient with the specified email address
    var newRecipient = nms.recipient.create('<recipient xtkschema="nms:recipient" email="' + email + '" firstName="' + firstName + '" lastName="' + lastName + '" text1="' + text1 + '" text2="' + text2 + '" text3="' + text3 + '" folder-id="' + iRecipientFolderId + '" />');
    newRecipient.save();

    iRecipientId = newRecipient.id;

    //subscribe to service
    var iServiceId = sqlGetInt("SELECT iServiceId From NmsService WHERE sName = 'NameOfService'");
    xtk.session.Write(<subscription _operation="insert" recipient-id={iRecipientId}
      service-id={iServiceId}
      xtkschema="nms:subscription" />);

 

Thanks for any help you can offer.

Accepted Solutions (1)

Accepted Solutions (1)

Avatar

Avatar
Validate 1
MVP
_Manoj_Kumar
MVP

Likes

111 likes

Total Posts

310 posts

Correct Reply

97 solutions
Top badges earned
Validate 1
Contributor
Ignite 1
Shape 1
Give Back 5
View profile

Avatar
Validate 1
MVP
_Manoj_Kumar
MVP

Likes

111 likes

Total Posts

310 posts

Correct Reply

97 solutions
Top badges earned
Validate 1
Contributor
Ignite 1
Shape 1
Give Back 5
View profile
_Manoj_Kumar
MVP

05-11-2020

Hello @AquaticAds 

 

Replace your subscription logic with this one and try if this works

 

nms.subscription.Subscribe("INTERNAL_NAME_OF SERVICE", RECIPIENT_OBJECT, false)

If this does not work then you will have to use the sendConfirmation method

 

Thanks,

Manoj 

Answers (1)

Answers (1)

Avatar

Avatar
Applaud 5
Level 1
ap0990
Level 1

Likes

0 likes

Total Posts

3 posts

Correct Reply

0 solutions
Top badges earned
Applaud 5
View profile

Avatar
Applaud 5
Level 1
ap0990
Level 1

Likes

0 likes

Total Posts

3 posts

Correct Reply

0 solutions
Top badges earned
Applaud 5
View profile
ap0990
Level 1

25-02-2021

Hi @AquaticAds ,

 

I have a similar requirement and hope you can help.

 

I have created a webapp with type subscription and after Subscription page using the JS code you have shared in your post but still not getting any email upon subscription.

 

Could you please share the steps you followed ?

 

Thanks.