[SalesForce] Dynamic Sender Profile not working – Marketing Cloud

I am trying to implement a dynamic sender profile. I have followed instructions from answers on similar questions on stack exchange. From what I understood this should work. However, every time I do a test send the email in my inbox shows a
blank from name and from address. I would be much appreciated if someone could tell me what I am doing wrong.

I did the following:

  1. Created a DE called "Dynamic_Sender_Profiles" with 3 attributes: "Locale", "SenderName" and "SenderEmail"

Sendable data extensions that contain subscribers also have a "Locale" attribute.

  1. Created a HTML content block (CustomerKey = DynamicSenderProfile) with the following AMPscript:

    %%[
    
    Var @fromname, @fromaddress, @locale, @row, @rows, @rowcount
    
    SET @locale = AttributeValue("Locale")
    
    SET @rows = LookupRows("ENT.Dynamic_Sender_Profiles", "Locale", @locale)
    SET @rowCount = rowcount(@rows)
    
    IF @rowCount > 0 then
    
    SET @row = row(@rows,1) 
    SET @fromname = field(@row,"SenderName")
    SET @fromaddress = field(@row,"SenderEmail")
    
    ENDIF
    
    ]%%
    

I've tested the AMPscript by itself by implementing the AMPScript block and the %%=v(@fromname)=%% and %%=v(@fromaddress)=%% in the template of random email. In preview mode it showed me the correct values.

  1. I created a sender profile with the following from name and from email:

From Name:

    %%=ContentBlockByKey("DynamicSenderProfile")=%%%%=v(@fromname)=%%

From Email:

    %%=ContentBlockByKey("DynamicSenderProfile")=%%%%=v(@fromaddress)=%%

Best Answer

Not sure the AMPscript block tags are valid in the Sender Profile configuration.

Give this a try:

From Name:

%%=ContentBlockByKey("DynamicSenderProfile")=%%%%=v(@fromname)=%%

From Email:

%%=ContentBlockByKey("DynamicSenderProfile")=%%%%=v(@fromemail)=%%

I'm assuming that the AMPscript in your content block does have the beginning and ending block tags: %%[ ]%%.

Also, the classification in your send definition includes the dynamic profile, right?

Related Topic