1

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)=%%
  • Updated my question with current configurations and issue. – Rutger Vogelsang Nov 14 '18 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. – Gortonington Nov 14 '18 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! – Rutger Vogelsang Nov 19 '18 at 14:18
1

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?

  • 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. – Rutger Vogelsang Nov 14 '18 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. – Rutger Vogelsang Nov 14 '18 at 10:26
0

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. – Rutger Vogelsang Nov 13 '18 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)? – Lukas Lunow Nov 13 '18 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. – Rutger Vogelsang Nov 13 '18 at 16:21
  • I am referring to where you are placing the AmpScript block in your point 2 – Lukas Lunow Nov 13 '18 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 %%= =%% – Gortonington Nov 13 '18 at 18:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.