ASPX templates
Version 5.x > ASPX templates > Newsletter single sent uses different transformation than subsciberlist? View modes: 
User avatar
Member
Member
olaf-elan - 1/4/2011 8:23:10 AM
   
Newsletter single sent uses different transformation than subsciberlist?
Hi

In Kentiko v5.5.3880 I created a newsletter.

I used a template for the letter itself. I published it as a document so i can use it as an online version also.

In the newsletter configuration I used this document location as the source page.


In the template I used a link for the online version:
<a href='HTTP://{%domain%}/cmsmodules/newsletters/cmspages/getnewsletterissue.aspx?issueid={%issueid%}' >online </a>


If i use a single sent i {%domain%} is transformed to the correct domain (slappebodem.nl)
But when the letter actually gets posted using the subscribers list it is not transformed.

Everyone receives {%domain%} and {%issueid%} in their mail.

Why is this transformation different??

Is there a woraround / fix to it?

Regards,
Olaf



User avatar
Kentico Developer
Kentico Developer
kentico_ivanat - 1/10/2011 5:56:49 AM
   
RE:Newsletter single sent uses different transformation than subsciberlist?
Hi,

If I got it the right way you have created a static newsletter based on "Newsletter issue template" and checked Show newsletter issue in archive. In the body of a newsletter issue you inserted following code:

<a href="HTTP://{%domain%}/cmsmodules/newsletters/cmspages/getnewsletterissue.aspx?issueid={%issueid%}">online </a>

If you sent newsletter using Send the newsletter to specified e-mail addresses (separate them with semicolon ";") macros in newsletter were resolved correctly. If you selected Send now to all subscribers option macros were not resolved?

I followed the above scenario and the macros were resolved correctly in both cases. I tested it with hotfix 27. Could you please try to apply the same or the latest hotfix for 5.5 version? If the hotfix will not help, could you please grant us with an access to your site? (you might send it to support@kentico.com with reference to this thread)

Best regards,
Ivana Tomanickova


User avatar
Member
Member
olaf-elan - 1/12/2011 8:38:18 AM
   
RE:Newsletter single sent uses different transformation than subsciberlist?
Thanks for testing,

If i use a static newsletter it works.
But that is not what i want.
I want to sent a document that is published on the website.

So I used a dynamic newsletter.
In the configuration the source page URL refers to a page in the same website.

In my case: http://www.slappebodem.nl/Nieuws/Nieuwsbrieven/Nieuwsbrief
In the aspx template I wrote:

<div id="Info" runat="server">If this message isn't received properly you can also view it <a href='HTTP://{%domain%}/cmsmodules/newsletters/cmspages/getnewsletterissue.aspx?issueid={%issueid%}' >online </a></div>

I was aware it might not work, so i did a test send to my own e-mail adress.

All macros were tranformed nicely into an issue and a domain name.

But when it is send to the distribution list, The newsletter showed the macro's untransformed as text.


Any ideas?


User avatar
Kentico Developer
Kentico Developer
kentico_ivanat - 1/12/2011 3:16:03 PM
   
RE:Newsletter single sent uses different transformation than subsciberlist?
Hi,

Resolving macros on aspx template is not officially supported. In your case you can create a link easily if you insert URL of your dynamic newsletter source page, which is http://your_domain/Nieuws/Nieuwsbrieven/Nieuwsbrief.aspx

Issue id is not important in this case. The content of issue is not stored in the database in case of dynamic newsletters. It means only the newest version is available and it is actually dynamic newsletter source page.

Best regards,
Ivana Tomanickova

User avatar
Member
Member
olaf-elan - 1/13/2011 3:37:45 AM
   
RE:Newsletter single sent uses different transformation than subsciberlist?
Hi Ivana,

Thank you for testing it on my cms.

That is a pity.
Since i need issues in my case.

My current version of kentico also generates issues also in case of dynamic newsletters.
They are automatically stored in the database.
I like this behaviour. Can you comfirm if this is correct and if will be sustained in coming updates?


I debugged the sending module and found out issueid is not available at the moment of sending. (only in this case)


This leaves me two options:
[1] In the template find out the highest issueid available i the system and add 1 to it.
[It might work perfectly, since the time between wrapping and sending and issue generation is relatively short. The chance of any other newsletterissue being send simultaniously is small, but if it happens id's might be mixed. Kentico also doen't support domain separation for newsletters, so newsletters from different domains may be mixed too.(!) Small chances, but worth considering the risk....

[2] Use static templates instead....

Thank you for your time.
I think i will try option 1 first.


Regards,
Olaf Brand

User avatar
Kentico Developer
Kentico Developer
kentico_ivanat - 1/13/2011 6:19:52 AM
   
RE:Newsletter single sent uses different transformation than subsciberlist?
Hi,


My current version of kentico also generates issues also in case of dynamic newsletters.
They are automatically stored in the database.
I like this behaviour. Can you comfirm if this is correct and if will be sustained in coming updates?


Yes, you are right. The issue is really created in case of dynamic issue, but the content of this issue is not stored in the database. You can see it if you take a look at Newsletter_NewsletterIssue table - IssueText column. In case of static issue is xml file created, in case of dynamic issue it is not (the content data are not really stored - it means that if you change the content of dynamic newsletter source page there is no way to see original content). (Maybe using some customization working with workflow and versioning.)

To sum up:
<a href='HTTP://domain/cmsmodules/newsletters/cmspages/getnewsletterissue.aspx?issueid=12' >online </a>
and
<a href='HTTP://domain/cmsmodules/newsletters/cmspages/getnewsletterissue.aspx?issueid=13' >online </a>

will display the same content which is current version of source page defined in configuration of dynamic newsletter.


The chance of any other newsletterissue being send simultaneously is small, but if it happens id's might be mixed. Kentico also doesn't support domain separation for newsletters, so newsletters from different domains may be mixed too.(!) Small chances, but worth considering the risk....


I do not know the exact way how you are using your code with link on the aspx template. But in the definition of dynamic newsletter you have to insert the full address: http://yourdomain/pathToPage.aspx, therefore the newsletter issue will be created based on this page and its template (and link with path defined on this template). And this link will redirect the user to the document itself.

But if you need to generate domain dynamically for some reason, you can do it in the code behind using for example:
UrlHelper.GetCurrentDomain();

Best regards,
Ivana Tomanickova

User avatar
Member
Member
olaf-elan - 1/14/2011 7:45:24 AM
   
RE:Newsletter single sent uses different transformation than subsciberlist?
It works now like a charm!


You can see it if you take a look at Newsletter_NewsletterIssue table - IssueText column. In case of static issue is xml file created, in case of dynamic issue it is not (the content data are not really stored - it means that if you change the content of dynamic newsletter source page there is no way to see original content).


I can't confirm this, my database stores unique xml/HTML for in each issue in column[IssueText] Also for dynamic letters.

I use a standard page template, not a special newsletter template. (I could have sent any content (eg www.google) if i wanted. Now i want to sent some sitepage page each time. And let the user modify it and re-publish it.


(Maybe using some customization working with workflow and versioning.)


I know what you mean. This is way too complex.
Each page should refer to its own location and version...


I hope there is a more db-efficient way to resolve the highest issue id.
If there are a lot of issue a huge dataset is loaded.



System.Data.DataSet issues = IssueProvider.GetIssues("IssueID>0", "IssueID Desc");
HighestIssue= Convert.ToInt32(issues.Tables[0].Rows[0].ItemArray[0]);
OnlineLink.NavigateUrl = "http://" + UrlHelper.GetCurrentDomain() +"/cmsmodules/newsletters/cmspages/getnewsletterissue.aspx?issueid=" + Convert.ToString(HighestIssue + 1);




Anyway, it finaly works like it should be.
Thanx for the help.

Olaf