I want to use only one template for sending to different sendable Data Extensions with different fields. How can I manage it when I set the user data like this
%%[
Var @COUNTRYCODE, @LANGUAGECODE, @SFID, @EMAIL, @FIRSTNAME
DE1:
Set @LANGUAGECODE = TRIM(Language)
Set @COUNTRYCODE = TRIM(Country)
Set @FIRSTNAME = FirstName
Set @SFID = TRIM(Salesforce_ID)
Set @EMAIL = TRIM(EmailAddress)
DE2:
Set @LANGUAGECODE = TRIM(Lead:Email_Newsletter_language__c)
Set @COUNTRYCODE = TRIM(Lead:Website_Country__c)
Set @SFID = Lead:Id
Set @EMAIL = Lead:Email
Thanks!
Oliver
I now let the Marketing Manager set the name of the Sendable Data Extension over an Additional Email Attribute
%%[ /* Set user date */
Var @COUNTRYCODE, @LANGUAGECODE, @SFID, @EMAIL, @VERSION, @DataExtension
SET @VERSION = _DataSourceName Set @DataExtension = "%%__AdditionalEmailAttribute3%%"
IF INDEXOF(@VERSION, @DataExtension) > 0 THEN Set @LANGUAGECODE = LOWERCASE(TRIM(ATTRIBUTEVALUE("Language"))) Set @COUNTRYCODE = TRIM(ATTRIBUTEVALUE("Country")) Set @SFID = TRIM(ATTRIBUTEVALUE("Salesforce_ID")) Set @EMAIL = TRIM(ATTRIBUTEVALUE("EmailAddress")) ELSE Set @LANGUAGECODE = TRIM(ATTRIBUTEVALUE("Lead:Email_Newsletter_language__c")) Set @COUNTRYCODE = TRIM(ATTRIBUTEVALUE("Lead:Website_Country__c")) Set @SFID = ATTRIBUTEVALUE("Lead:Id") Set @EMAIL = ATTRIBUTEVALUE("Lead:Email") ENDIF ]%%