icon Newsletter
Created by Orckestra

Newsletter Developer Guide

Getting Newsletter ID

You can add a link in the newsletter to publicly show this newsletter on a page on your website. For this, you need to get the newsletter’s ID via an ad-hoc CMS function.

Please note that you can only get the ID from within the newsletter. That is why this function must be inserted either in the newsletter itself or in the newsletter template in use.

Creating a function is up to you; however, you need to add an input parameter of a specific type and set up its default value as described below:

  1. Create an XSLT function, for example, "Demo.Newsletter.ShowOnPage".
  2. Add an input parameter of the String type to the function, for example, "Newsletter".
  3. In the default value of this parameter, remove the "Composite.Constant.String" function and add the "Composite.Utils.GetInputParameter" function.
  4. In its "Parameter name" parameter, type in "NewsletterId" (exactly as here).
  5. On the “Template” tab, make use of this parameter's value (GUID), the way you need.
  6. Insert this function in the newsletter or newsletter template.

When the recipient receives this newsletter, it will contain its ID.

You can implement Step 5 as you need accessing the newsletter ID as /in:inputs/in:param[@name='Newsletter'] in your XSLT.

For illustration purposes, let's assume that you have a page ~/ViewNewsletter. It expects a query string parameter "Newsletter" with a newsletter's ID and shows the newsletter’s content by its newsletter ID.

In the template of your function, the markup may be similar to this:

<a href="~/ShowNewsletter?Newsletter={/in:inputs/in:param[@name='Newsletter']}">View Online</a>
 
Back to top
Part of subscriptions:

Have a question?

Phone: +45 39 15 76 00
Email: Write us
7:30 PM
(Local time at HQ)