2

We have a data extension in Marketing Cloud which has the following fields:

  • first name (email)
  • last name (text)
  • email (email)
  • alternateemail (text)
  • customer id (number)

We have customers who use 2 email id like work and home email and we want to send an email campaign to both email ids per record. The standard out of the box Marketing Cloud does not send to both email ids and so we are thinking of using an AMPScript which can send the emails out.

Did any of you come across this scenario and if so can you share some AMPScript snippets which would query this Data Extension and send 2 emails per record in the Data Extension?

3
  • 3
    You wouldn't do this with AMPScript, although I could imagine a horrible hack using the API. It's not a great solution, but could you consider creating multiple records in your sendable data extension - one for each email address? You'll need to choose your SubscriberKey quite carefully (likely the actual email address being used). Customer ID could not be shared by all the records for a customer as the email that's actually used for the send would be the email address held in All Subscribers, so each record in your DE would need its own unique Subscriber Key.
    – Macca
    Jan 25, 2017 at 3:53
  • Great solution. I can have 2 records in my data extension for both emails but the issue is when i sync it with salesforce, they both relate to one contact id. I can't duplicate this in salesforce. So in this scenario, how would we make sure any tracking results on the email sync back to the same contact id in salesforce? Jan 26, 2017 at 0:32
  • You're going to have a challenge on your hands getting this to work with Salesforce CRM, I think. To get tracking data back to SFDC from SFMC, you're going to need to use the Contact or Lead ID from SFDC as the SubscriberKey. The trouble is, when using this ID as the SubscriberKey, unless you're using a triggered send, SFMC will use the email address it has for the Subscriber from All Subscribers, and not from the DE you're sending to. Is your use case amenable to using triggered sends or is this a batch type use case?
    – Macca
    Jan 30, 2017 at 3:32

1 Answer 1

2

I agree with Andrew McLeod's comment. AMPScript is not the right way to approach this.

My recommendation would be to separate your audiences with a Query Activity before the send and then add both audiences in your User-Initiated Send Definition. Something like this:

select 
[first name] 
, [last name]
, email
, [customer id]
from YourDataExtension

union 

select 
[first name] 
, [last name]
, alternateemail as email
, [customer id]
from YourDataExtension

The target, sending Data Extension would just have these columns:

  • first name
  • last name
  • email (emailaddress, primary key)
  • customer id
2
  • Great solution. I can have 2 records in my data extension for both emails but the issue is when i sync it with salesforce, they both relate to one contact id. I can't duplicate this in salesforce. So in this scenario, how would we make sure any tracking results on the email sync back to the same contact id in salesforce? Jan 26, 2017 at 0:31
  • Hi @Adam Spriggs By your solution, I am thinking it would be 1 record in the data extension with email and alternate email as 2 fields in the DE and i can have the query activity split them as 2 emails. Is that right or do i need to still duplicate it as 2 records in data extension? Jan 26, 2017 at 0:34

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .