Portal Engine Questions on portal engine and web parts.
Version 6.x > Portal Engine > Dynamic Newsletter Configuration - Is it possible to generate the subject line pulled from another document? View modes: 
User avatar
Certified Developer v7
Certified  Developer v7
spengelly - 1/19/2012 2:24:10 PM
   
Dynamic Newsletter Configuration - Is it possible to generate the subject line pulled from another document?
I am using the dynamic newsletter configuration to send out a newsletter. I would like the subject line of the emails that get sent to be generated based on the title of another document. The newsletter page I have built consists of a repeater pulling recent news items with links to the news articles on the site. I want the subject of the email to pull the title of the most recent news item.

In the newsletter module I tried the first option "Use page title for subject" and created a macro that ran a query pulling the top 1 news record and returned the title string. I put this macro in the metadata page title field in the document properties. I viewed the page in a browser and it displayed the title correctly. I then sent myself a test issue, the subject line was rendered blank.

Is it possible to use macros in the metadata page title field when sending a dynamic newsletter?

I also tried to embed the macro in the Newsletter Module > Newsletter Configuration Tab > Subject > "use the following subject". This had the same results - the subject line was blank. Can you use macros in this field? Is there a way using K# to do something like this?

Thanks,

Sarah

User avatar
Kentico Support
Kentico Support
kentico_janh - 1/23/2012 2:55:31 AM
   
RE:Dynamic Newsletter Configuration - Is it possible to generate the subject line pulled from another document?
Hello,

Actually, the second option should work (it works on my end). Are you sure, that your custom macro doesn't return empty string? Could you please define the following macro to be sure, that the macro resolver works fine:
case "hello":
e.Match = true;
e.Result = "Hello World!";
break;

And fill the Dynamic newsletter configuration -> Use the following subject with:
{#hello#}

Best regards,
Jan Hermann

User avatar
Certified Developer v7
Certified  Developer v7
spengelly - 1/27/2012 2:32:34 PM
   
RE:Dynamic Newsletter Configuration - Is it possible to generate the subject line pulled from another document?
Thanks for your help. I was incorrectly trying to use a macro method. It now works with option two.
Regards,

Sarah