Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

New user account email not in HTML format?
iamjwk
#1 Posted : Thursday, 13 May 2010 1:56:15 AM(UTC)
Rank: Advanced Member

Joined: 24/04/2010(UTC)
Posts: 39
Location: Netherlands

When I receive an email informing me about a new user account its in plain text format, so I need to copy the url to the browser instead of just clicking it. I screened the settings of GSP, web.config etc. but could not find any setting related to this.

How do I setup to receive HTML messages instaid of text?

Regards,
Jan-Willem
Roger Martin
#2 Posted : Thursday, 13 May 2010 2:24:41 AM(UTC)
Roger Martin

Rank: Administration

Joined: 3/08/2007(UTC)
Posts: 3,301
Location: Fort Atkinson, WI

You cannot receive it in HTML format unless you modify the code to add this feature.

Many email programs - such as Outlook - automatically recognize URLs and present them as hyperlinks for you.

There are risks in sending an email in HTML rather than text, since some users use email programs that either cannot read HTML or for security reasons they have it turned off. The most robust way to ensure everyone can read the email is to use plain text.
Roger Martin
Creator and Lead Developer of Gallery Server Pro
iamjwk
#3 Posted : Thursday, 13 May 2010 2:30:20 AM(UTC)
Rank: Advanced Member

Joined: 24/04/2010(UTC)
Posts: 39
Location: Netherlands

You are right about the risks. Bypass is to forward the email to myself in HTML format and the links work.

If I want to change it in the code, where should I do that?

Jan-Willem
Roger Martin
#4 Posted : Thursday, 13 May 2010 2:48:05 AM(UTC)
Roger Martin

Rank: Administration

Joined: 3/08/2007(UTC)
Posts: 3,301
Location: Fort Atkinson, WI

1. Modify one or more of the email templates in the Website\gs\templates directory so that the [Body] section contains HTML instead of plain text.

2. Modify the function Website\CodeFiles\Controllers\EmailController.SendNotificationEmail so that it calls the overload of the SendMail function that includes the isBodyHtml parameter. Set this parameter to true.

Note: You will notice that the new version of SendMail you will be calling takes a MailAddressCollection parameter instead of a MailAddress, so you'll have to modify SendNotificationEmail to wrap your MailAddress into a collection. Use this code:

Code:
MailAddressCollection mailAddresses = new MailAddressCollection();
mailAddresses.Add(emailRecipient);

Roger Martin
Creator and Lead Developer of Gallery Server Pro
iamjwk
#5 Posted : Thursday, 13 May 2010 3:23:25 AM(UTC)
Rank: Advanced Member

Joined: 24/04/2010(UTC)
Posts: 39
Location: Netherlands

OK, thanks Roger. When my new site is up and running I will try it.

Jan-Willem
Rss Feed  Atom Feed
Users browsing this topic
Guest
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.