I am trying to send an email and in the footer I need to include the [Unsubscribe]
, [SITEURL]
, [PORTALNAME]
hyperlinks that come with some default DNN emails.
What I have done so far:
I created a
test.resx
file under my custom module'sApp_LocalResources
folder. In this file I have an entryMY_EMAIL_TEST.Text
In this entry myhtml
looks like:<!-- // Begin Module: Standard Preheader \ --> <table border="0" cellpadding="0" cellspacing="0" align="center" > <tr> <td align="center"> <p>Copyright 2013 <a href="[SITEURL]">[PORTALNAME]</a> All rights reserved.</p> <p>If you wish to no longer receive emails in the future, please <a href="[UNSUBSCRIBEURL]">unsubscribe</a> here.</p> </td> </tr> </table> <!-- // End Module: Standard Preheader \ --> </td> </tr> </table> <!-- // End Template footer \\ -->
which is basically some HTML that I have copy/pasted from the EMAIL_MESSAGING_DISPATCH_BODY.Text which is in the GlobalResources.
I get the string from this file like this:
Dim body = Localization.GetSystemMessage(GetPortalSettings, "MY_EMAIL_TEST.Text", "DesktopModules/FinBidders/App_LocalResources/test.resx")
I send the email:
DotNetNuke.Services.Mail.Mail.SendMail(Host.HostEmail, oUserInfoReceiver.Email, "", "", DotNetNuke.Services.Mail.MailPriority.Normal, "my subject", DotNetNuke.Services.Mail.MailFormat.Html, Text.Encoding.Default, body, "", Entities.Host.Host.SMTPServer, Entities.Host.Host.SMTPAuthentication, Entities.Host.Host.SMTPUsername, Entities.Host.Host.SMTPPassword,False)
Notice that I specify that the format is MailFormat.Html
.
Now the email I receive has NO hyperlinks to unsubscribe, portalname or siteurl. They appear as text!
Email content after it is received:
Copyright 2018 [[SITEURL]][PORTALNAME] All rights reserved.
If you wish to no longer receive emails in the future, please > [[UNSUBSCRIBEURL]]unsubscribe here.
How can these links be formatted with the proper hyperlink?