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")

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:


From Email:

  • Updated my question with current configurations and issue. Commented Nov 14, 2018 at 10:43
  • your conditional has an html entity instead of the actual symbol. > is not the same as >. Try replacing this and see if that resolves your null results. Commented Nov 14, 2018 at 13:47
  • I already simplified the AMPscript and was not using the > (>) anymore, but I was still running into the same problem. But I solved the issue by saving the AMPscript in the HTML content block as a code snippet and then refer to the code snippet in the SP via ContentBlockByKey! Thank you all for your help! Commented Nov 19, 2018 at 14:18

3 Answers 3


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

Give this a try:

From Name:


From Email:


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?

  • Hi Adam, thank you for your help. I changed the AMPscript block tags in the sender profile as you suggested. Also, yes the AMPscript in the content block has the righht beginning and ending block tags. Also the send definition that I use for testing includes the dynamic sender profile. Commented Nov 14, 2018 at 10:25
  • I did another test send. It no longer falls back on the default business unit sender name and address, so that is good thing I guess. However, the from name and address are now blank, so for some reason it is still not working correctly. I checked the data extension containing dynamic sender names and addresses. It is still populated and contains the same locales that I am using for testing. Also checked the customerkey for the HTML block, which matches with the one where the ContentBlockByKey is refering to. Commented Nov 14, 2018 at 10:26
  • I also had to make sure the content block was a Code Snippet and I had to put a space in between the contentblockbykey and the v functions to make it work. Without the space I got a canceled job error. Commented May 10, 2022 at 14:01

I suspect this is being caused by the AmpScript being run in Content Builder block. Try taking the code out of the block, and put it in the template, before any HTML gets rendered - so it is basically within the very first lines of the email.

  • 1
    Thank you for your response Lukas. Using a HTML content block and then refering to this via ContentBlockByKey was the recommended solution on stackexchange because the sender profile is processed prior to the email. Putting the AMPscript in the email will therefor not help. Commented Nov 13, 2018 at 16:09
  • Which is also a suitable way - but where do you call ContentBlockByKey? Is it in the very beginning of your email (before any HTML)? Commented Nov 13, 2018 at 16:11
  • In the sender profile configuration I make use of the "Use the specified information:" option. There I inserted the Contentblockbykey as described in point 3 of my question. Commented Nov 13, 2018 at 16:21
  • I am referring to where you are placing the AmpScript block in your point 2 Commented Nov 13, 2018 at 16:23
  • You are correct @RutgerVogelsang in your method, but @LukasLunow and @AdamSpriggs are correct it should not be in a block, but it shouldn't be in the email (Processed separately from Email Body), but instead called in profile using the inline AMPscript declarations %%= =%% Commented Nov 13, 2018 at 18:28

I recently ran into issues using this process for the dynamic sender profile but ran into issues in the from name and from email field. This did eventually work:
From Name: %%[ContentBlockbyId("124206")]%% %%=v(@FromName)=%%
From Email: %%[ContentBlockbyId("124206")]%% %%=v(@FromEmail)=%%

The things that worked with this:

  • Using %%[ (instead of %%=) to call in the content block
  • The space between the content block and the variable was necessary, especially in the email field (if there was not a space the sender profile wouldn't show up in the drop down list)

You must log in to answer this question.

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