logo
Welcome to our new AbleCommerce forums. As a guest, you may view the information here. To post to this forum, you must have a registered account with us, either as a new user evaluating AbleCommerce or an existing user of the application. For all questions related to the older version of Gold and earlier, please go to AbleCommerce Gold forum. Please use your AbleCommerce username and password to Login. New Registrations are disabled.

Notification

Icon
Error

Options
Go to last post Go to first unread
ray22901031  
#1 Posted : Monday, January 2, 2023 10:53:06 AM(UTC)
ray22901031

Rank: Advanced Member

Groups: Authorized User, Developers
Joined: 2/17/2019(UTC)
Posts: 909

Thanks: 3 times
Was thanked: 15 time(s) in 15 post(s)
Could someone check under the new version if the email template "Send Product To Friend" it's working for you properly?

In our case, it is not working, and it seems that whatever e-mail is being used by a user trying to send this template to a friend, actually gets overridden in the back end of the database.

You will get an error message in the back end that says, that the e-mail server cannot send to this particular e-mail address and the e-mail template itself now has Sent-To and Sent-From completely overridden where before it used to be, customer and merchant as values.

This is very strange.

-Ray

Edited by user Monday, January 2, 2023 11:56:13 AM(UTC)  | Reason: Not specified

Wanna join the discussion?! Login to your AbleCommerce Forums forum account. New Registrations are disabled.

judy at Web2Market  
#2 Posted : Tuesday, January 3, 2023 5:44:03 AM(UTC)
judy at Web2Market

Rank: Advanced Member

Groups: Developers
Joined: 11/7/2018(UTC)
Posts: 303

Thanks: 21 times
Was thanked: 5 time(s) in 5 post(s)
This is on my local site. I hadn't checked the setting in the admin for send to friend email so the first one I sent used the wrong template. Then when I configured it correctly, it sent the correct email with the sent from being OK. When I looked at the template in the admin, the from and to email address were the ones for the current situation- customer email and send to email. I think I had seen this happen in older versions of AC, but can't remember if AC considered it a bug or not.
shaharyar  
#3 Posted : Tuesday, January 3, 2023 10:39:38 AM(UTC)
shaharyar

Rank: Advanced Member

Groups: Admin, Developers, Registered, HelpDesk, Authorized User
Joined: 10/5/2018(UTC)
Posts: 704

Thanks: 5 times
Was thanked: 113 time(s) in 112 post(s)
Hi Ray,

We have tested it on our side and this is working fine.


Quote:
it seems that whatever e-mail is being used by a user trying to send this template to a friend, actually gets overridden in the back end of the database.


This is true and this is what needs to be fixed. Even though this will not affect anything unless the email template is being used with a trigger which is highly unlikely.
I have reported the issue and will be fixed in a future version.

The From email added in the pop-up will actually appear in the email template as text.

Quote:
You will get an error message in the back end that says, that the e-mail server cannot send to this particular e-mail address


We cannot see any error message in the error logs. Can you please share details if any?

Edited by moderator Tuesday, January 3, 2023 10:44:00 AM(UTC)  | Reason: Not specified

ray22901031  
#4 Posted : Tuesday, January 3, 2023 10:46:19 AM(UTC)
ray22901031

Rank: Advanced Member

Groups: Authorized User, Developers
Joined: 2/17/2019(UTC)
Posts: 909

Thanks: 3 times
Was thanked: 15 time(s) in 15 post(s)
Thank you for looking into this. Below is the error message that I'm getting. My e-mail settings are correct, so I'm not certain why this particular template is being affected. I went back to version 9.0.5, and I get the same error message in the back end. I will discuss this with my developer tomorrow.

Error sending email with subject 'Ray wants you to see this item at MyRadioMall.com'. View less
Exception: Mailbox unavailable. The server response was: 5.1.0 Sender is not allowed to send from comcast.net (R2) Stack Trace: at System.Net.Mail.DataStopCommand.CheckResponse(SmtpStatusCode statusCode, String serverResponse) at System.Net.Mail.DataStopCommand.Send(SmtpConnection conn) at System.Net.Mail.SmtpConnection.OnClose(Object sender, EventArgs args) at System.Net.ClosableStream.Close() at System.Net.Mail.MailWriter.Close() at System.Net.Mail.SmtpClient.Send(MailMessage message) at CommerceBuilder.Messaging.EmailClient.Send(MailMessage mailMessage, SmtpSettings smtpSettings, Boolean throwOnError) in D:\Users\Ashlee\Able-MRM-9.0.7\Projects\AbleSource\CommerceBuilder\Messaging\EmailClient.cs:line 66

Thanks
nadeem  
#5 Posted : Tuesday, January 3, 2023 11:26:04 AM(UTC)
nadeem

Rank: Advanced Member

Groups: Administrators, Developers, Registered, HelpDesk, Authorized User, Admin, System
Joined: 10/11/2018(UTC)
Posts: 110

Thanks: 19 times
Was thanked: 18 time(s) in 18 post(s)
This seems a relay issue. Can you try setting the From email address to the store default email address. That is,

Locate the following line of code inside ProductTellAFriend post action

Code:
template.FromAddress = model.Email;



and replace with

Code:

template.FromAddress = AbleContext.Current.Store.Settings.DefaultEmailAddress;
ray22901031  
#6 Posted : Tuesday, January 3, 2023 11:37:42 AM(UTC)
ray22901031

Rank: Advanced Member

Groups: Authorized User, Developers
Joined: 2/17/2019(UTC)
Posts: 909

Thanks: 3 times
Was thanked: 15 time(s) in 15 post(s)
I am on my way to the office. I will do this tonight and get back to you. Many thanks for looking into this.

-Ray
ray22901031  
#7 Posted : Tuesday, January 3, 2023 8:21:10 PM(UTC)
ray22901031

Rank: Advanced Member

Groups: Authorized User, Developers
Joined: 2/17/2019(UTC)
Posts: 909

Thanks: 3 times
Was thanked: 15 time(s) in 15 post(s)
I made the changes and recompiled, and it works, however the following bugs or what I consider to be bugs remain.

Yes, I understand that the message now comes from the new default e-mail from the website which in our case is "noreply@MyRadioMall.com", but the bottom of the template needs to show the user's e-mail that sent the message, not the default website.

I'm not certain how to fix this on the actual template itself, any suggestions would be helpful. Please see below.


=== Email Template ===
Check out CP100D Portable UHF 16CH ANALOG Radio
Hello,
I found this at MyRadioMall.com and thought of you.
CP100D Portable UHF 16CH ANALOG Radio
Best Regards,
Ray Fernandez
________________________________________
noreply@MyRadioMall.com requested that we send this email.
Thank you!
MyRadioMall.com

UPDATE: THE ABOVE HAS BEEN FIXED !!!

Edited by user Tuesday, January 3, 2023 9:43:27 PM(UTC)  | Reason: Not specified

ray22901031  
#8 Posted : Tuesday, January 3, 2023 8:34:12 PM(UTC)
ray22901031

Rank: Advanced Member

Groups: Authorized User, Developers
Joined: 2/17/2019(UTC)
Posts: 909

Thanks: 3 times
Was thanked: 15 time(s) in 15 post(s)
Hi Judy,

Thank you for the reply, but if you're ProductController.cs file at about line 2722 has "template.FromAddress = model.Email;", I do not see how this could be working for you.

I would verify this just to make sure. Either way, support knows that the e-mail addresses supplied by the user should not end up in the template itself.

In fact, I would consider this a security issue because the user can now post to the database itself in the back end. Not a good thing, you never know if somebody could figure out a way to insert a query string that could mess things up.

You are welcome to share any thoughts you have on this.

-Ray
nadeem  
#9 Posted : Wednesday, January 4, 2023 7:10:13 AM(UTC)
nadeem

Rank: Advanced Member

Groups: Administrators, Developers, Registered, HelpDesk, Authorized User, Admin, System
Joined: 10/11/2018(UTC)
Posts: 110

Thanks: 19 times
Was thanked: 18 time(s) in 18 post(s)
Quote:
Thank you for the reply, but if you're ProductController.cs file at about line 2722 has "template.FromAddress = model.Email;", I do not see how this could be working for you.


Most of the email server providers don't allow a from email address to a email that does not match the email of the account used to authenticate their email server to reduce spamming. It might be working for Judy because she may be using the provider that hasn't this restriction.

Quote:

I would verify this just to make sure. Either way, support knows that the e-mail addresses supplied by the user should not end up in the template itself.


I agree with you. This shouldn't be happening. To fix this, you can reset the From and To addresses back to 'customer' and 'merchant' respectively after sending the email.

Here are the code changes that you can try:

Locate

Code:
//STRIP HTML
model.Name = StringHelper.StripHtml(model.Name);


and replace with

Code:

string fromAddress = template.FromAddress;
string toAddress = template.ToAddress;

//STRIP HTML
model.Name = StringHelper.StripHtml(model.Name);


//STRIP HTML
model.Name = StringHelper.StripHtml(model.Name);

Similarly, locate

Code:

template.Send();


and replace with

Code:

template.Send();
template.FromAddress = fromAddress;
template.ToAddress = toAddress;


Hope this helps!

FYI, a bug report has been registered to fix two issues:

1. Update from address to store default email address
2. Fix the From and To addresses in the email template so that those aren't overridden

Thank you!

Edited by user Wednesday, January 4, 2023 7:25:13 AM(UTC)  | Reason: Not specified

ray22901031  
#10 Posted : Wednesday, January 4, 2023 7:20:15 AM(UTC)
ray22901031

Rank: Advanced Member

Groups: Authorized User, Developers
Joined: 2/17/2019(UTC)
Posts: 909

Thanks: 3 times
Was thanked: 15 time(s) in 15 post(s)
Quote:
Most of the email server providers don't allow a from email address to a email that does not match the email of the account used to authenticate their email server to reduce spamming. It might be working for Judy because she may be using the provider that hasn't this restriction.


I understand your point, that being said, "template.FromAddress = model.Email;" leaves it up to the user where "template.FromAddress = "AbleContext.Current.Store.Settings.DefaultEmailAddress;" uses the same settings as pretty much every other e-mail template, and you control this setting in the Admin back end.

The user "from address" is already listed at the bottom of the e-mail template, so the receiving customer knows who instigated the e-mail, which is different from the system itself that is just forwarding it.

I do appreciate the prompt fix, but I will wait for the next version when this is properly fixed.

Thanks Again,
-Ray

Edited by user Wednesday, January 4, 2023 7:21:02 AM(UTC)  | Reason: Not specified

Users browsing this topic
Guest (8)
Forum Jump  
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.