Forum Notification Email in HTML

This is an open forum for any mojoPortal topics that don't fall into the other categories.

This thread is closed to new posts. You must sign in to post in the forums.
9/28/2010 7:18:38 AM
Gravatar
Total Posts 3

Forum Notification Email in HTML

Hello,

I had changed the template to the forum email notifications, but i realize that it isn't formatted has HTML and i put HTML tags in the template.

Is this supported? Forum notifications email with HTML format? How can i configure or do this?

Theres any example i can see?

thanks in advance,

José domingos

9/29/2010 9:28:01 AM
Gravatar
Total Posts 18439

Re: Forum Notification Email in HTML

currently only plain text notifications are supported. I will add a wish list item in the project tracker but I don't expect to get to this soon.

Best,

Joe

9/30/2010 4:22:26 AM
Gravatar
Total Posts 3

Re: Forum Notification Email in HTML

Hi joe,


I needed to make this and i noted that it was just a change in a parameter in the call of the function Email.SendEmail in the Notification.cs file, which makes the email to be sent in HTML format. I had made that hardcoded, but i think i was very simple to make a configuration to define that in the CMS.

And change the position of the post body in the email template, because for default it comes in the top of the email and i had put it in a TAG in the ForumNotificationEmail.config

I’m writing that because if someone needed that, what in my experience has web developer is always wanted by clients, the debug work i had made can be useful to someone else, because is very simple for any developer that wanted that.

It’s the second position form the last that is boolean and says if the email is in HTML format or not, what is in the original code with the false value.

If someone need to send notification in HTML just make that change that i post here. The local is the notification.cs page and the SendForumNotificationEmail function:

Email.SendEmail(
notificationInfo.SmtpSettings,
notificationInfo.FromEmail,
row["Email"].ToString(), "", "",
emailSubject.ToString(),
body.ToString(), true, "Normal");

Another thing i had to change is the fact that when the user clicks the unsubscribe, it goes to the UnsubscribeForumThread.cs page and it verifies if the user is authenticated and if not it send a message that says "access denied". Most of the cases a user receive a notification he doesn’t have a open session in the site, so, it should send the user to login page. In my case i just removed the verification because the access to the email account is some kind of user access validation.

Thanks for your time and i hope it helps others

José Domingos

9/30/2010 7:13:16 AM
Gravatar
Total Posts 18439

Re: Forum Notification Email in HTML

Hi Jose,

As I said, I made a wish list item for this in my project tracker, but I'm not sure when I will get to it. My recommendation is that no-one modify any mojoPortal source code. If you do that then you will find it difficult to upgrade without losing your customizations.

While your solution seems simple enough, it is not an acceptable solution. If/when I add support for html notifications it will require a more complicated solution to do it the way I think it should be done. The user should be able to specify whether he/she wants to receive html or plain text and this will require additional fields in the database and significantly more work than your solution.

Regarding the unsubscribe functionality, I agree with you 100%, it should not require the user to be authenticated in order to opt out using the opt out links in the email message. I've entered a bug for this in my project tracker.

Best,

Joe

9/30/2010 10:29:40 AM
Gravatar
Total Posts 3

Re: Forum Notification Email in HTML

Hello joe,

I really needed to make the modification because the client needed it. I had no other option to change the source code :(

And i agree with you and i had said that the best way was through configuration. I just made a change for a urgent situation like i have now.

The client make a demand for a specific notification layout in HMTL. I really understand you and i now the problems of that. But at this moment all the sites i had made, the clients wanted specific layout for every communication with the site users.

But now i ask you something that i really need. How can i make changes of the source code that are needed because of client specifications?

I like mojo and now i understand very well the source code and i had changed many things and i give you an example. For this project the client wanted that the news (blog module) should be able to have to fotos e in two separate localizations. I didn't find a way to do that without changing the source code in several layers.

I don't want to take your precious time, but with the small time we have for projects i couldn't made a module and i post that just to give you some feed back of my experiences.

thanks in advance.

José Domingos

9/30/2010 10:51:18 AM
Gravatar
Total Posts 18439

Re: Forum Notification Email in HTML

If you fork the code you will have no way to upgrade without losing your customizations to mojoportal code. There is nothing I can do to change that or solve it. If you do that then you and your customer will have to live with the consequences. I recommend explain the consequences and convince the customer about the down side of doing that. I can promise that sooner or later you or your customer will regret not being able to upgrade, there will be a new feature you want or a security fix or something.

Your options are as follows:

Wait until I get around to it which may be a while.

You can try to maintain your fork by creating patches of your changes and then try to re-apply them to the latest mojoportal code from time to time to get the latest mojoportal code, but over the long haul that will be a pain. whether that is viable depends on whether the customer will be a long term paying customer or whether you just do the work and move on. If you provide a fork that your customer cannot upgrade and then move on it will turn out badly one day when they get someone else to upgrade who doesn't know about your changes.

You can possibly convince me to prioritize the change by convincing your customer to sponsor the effort financially to make the changes. But my guess is they will not want to pay what it would take to convince me to drop my other priorities and do this right now.

You can possibly propose and develop a solution that meets my approval and contribute it to the project. Note however that the solution cannot be integrated unless it supports all the databases we support. you could possibly implement it for the db you use and convince your customer to sponsor my time to implement the other data layers so it can be integrated. To contribute, you would have to sign and return a contributor agreement. If your employer owns copyright to your work then a valid representative of the employer must also sign it.

So, the bottom line is people cannot get everything they want for free or cheap and sometimes have to accept what is reasonable and possible within their budget. 

Best,

Joe

You must sign in to post in the forums. This thread is closed to new posts.