Developer forum

Forum » Templates » Product Comments - Notification Email

Product Comments - Notification Email

Cátia Torego
Reply

I'm having a couple of issues with the comments notifications.

In the comments notification templates I always get an exception if I try to use a Translate. Is there a way to use translates in these templates?

When trying to send a reply notification i get an error (in the attached image) and the email doesn't get sent if the original comment was made by an anonymous user. Is there something I need to set when the user is anonymous to allow for the email in this cases?

 

DW version 9.7.2

 

NotificationReplyError.png

Replies

 
Nicolai Pedersen
Reply

You have not shown you template that causes the problem... I think the error is in your template. For both errors.

 

 
Cátia Torego
Reply

Hi Nicolai,

I attached my templates.  

The first issue, with the Translates, happens in the notification email and the reply notification email. As soon as i put a translate in there i get an NullReferenceException on the email.

The second issue i believe that is also related to the reply notification email, if i don't and the settings to send the email it works fine, if i set the email it will throw the error when trying to send it, but only if the parent comment was from an anonymous user. The comment itself still gets created.

 
Kristian Kirkholt Dynamicweb Employee
Kristian Kirkholt
Reply
This post has been marked as an answer

Hi Cátla

The problem is fixed in Dynamicweb 9.8.2 version

You are able to find this build in the download section:

http://doc.dynamicweb.com/releases-and-downloads/releases

Please contact Dynamicweb Support if you need any additional help regarding this.

Kind Regards
Dynamicweb Support
Kristian Kirkholt

Votes for this answer: 1
 
Cátia Torego
Reply

Hi Kristian,

After updating to 9.8.2

I'm still having the issue with the Translates in the email.  As soon as i put a translate in there i get an NullReferenceException on the email. Can't i used them in these templates?

 
Nicolai Pedersen
Reply

It is not a translate issue.

The problem is that you try to send an email from a user that does not exist. If I am anonymous, you have no Comment.NotifySenderEmail tag which is the sender of the mail. That will cause it to fail.

Also the exception indicates that your setup is missing a smtp host...?

BR Nicolai

 
Cátia Torego
Reply

Hi Nicolai,

The Comment.NotifySenderEmail is always setup to the the same user. Is not the one who creates the comment.

When i don't have Translates in the email template, the email gets send and it displays fine, for either anonimous users or loged in users.
As soon as i add a Translate tag in the email templates i get the error, in the email, so it still gets sent either way just displays an error.

email_without_translates.png email_with_translate.png
 
Nicolai Pedersen
Reply

Hi Cátia

Well, that is a totally different exception than the one you have in the top of this thread...

And it is also another template than you gave us.

You need to provide the correct information. We waste a lot of time...

 
Cátia Torego
Reply

Hi Nicolai,

I'm sorry you wasted your time, but i explained several times that i was having 2 diferent issues. And i clearly mentioned that the first image i provided was related to the second one, not the translate one.
Also i provided all my templates related to the comments, what other templates do you need me to provide?

  1. The first issue is related to the use of translates in the emails, and is the one i'm still having. Can't i used them in these templates?
     
  2. The second issue was related to the replies to the ononymous users, and the one from the first image. That one was fixed with the update.
 
Nicolai Pedersen
Reply

According to the exception in your template, the name of the template is RizzoNotify.cshtml

The template in the zip file is called Notify.cshtml

So, I need RizzoNotify.cshtml - my guess is that you have something interesting going on in line 5 that is causing the issue. You can try to strip the template from all includes etc. and just write  @Translat("something") to see if it really is a Translate issue or something else. I think it is something else.

 
Cátia Torego
Reply

The template is the exact same. The name was just changed recently.

And what i have difrent in there is just a Translate, just like i said, i add it to be able to show you the error. But here is the template anyway.

I have already tried to remove everithing and leave just a Translate and the issue still remains.

 

 

 

 

 
Morten Bengtson Dynamicweb Employee
Morten Bengtson
Reply

Hi Cátia,

There does seem to be an issue here. We are taking a closer look at it.

Best regards,
Morten

 
Kristian Kirkholt Dynamicweb Employee
Kristian Kirkholt
Reply

Hi Cátia,

The issue was fixed in Dynamicweb version 9.8.4

this build is available in download section

https://doc.dynamicweb.com/downloads/releases

Kind Regards
Dynamicweb Support
Kristian Kirkholt

 

You must be logged in to post in the forum