Request Quote Form (for 1.80 and 1.90)

9 years ago
super wrote:
hello mb,

In 1.9v website I created a 3rd request quote form in which is similar to the first request quote form, updated for 1.90

The only difference is that instead of sending it to store owner - I am sending it to 3 different recipients.

I have created settings for cc bcc - saved the correct e-mail address from administration area (in database) still the second person who is based on bcc never gets any e-mail, why ? If I put number of email address in one (bcc or cc) then store owner gets the email which means something is not working fine in the code.

This is my what I have:

The first request quote form, updated for 1.90: (Quote.ascx.cs)
[...]


The code you posted looks like a mix of RequestQuote and RequestQuote2; you can remove the following from the code you posted as it's not being used (it is used by MessageService.SendEmail in RequestQuote2):
List<string> bcc = new List<string>();
foreach (string str1 in bccEmails.Split(new char[] { ';' }, StringSplitOptions.RemoveEmptyEntries))
{
    bcc.Add(str1);
}
List<string> cc = new List<string>();
foreach (string str1 in ccEmails.Split(new char[] { ';' }, StringSplitOptions.RemoveEmptyEntries))
{
    cc.Add(str1);
}

I tested the code you posted (with your settings names -different emails) and found no problems with it. I debugged the SendQueuedMessagesTask and it is working as it should -all email address are set for the message as they should be. I did notice that if an email message is specified twice in all the addresses (e.g. in TO and in BCC), the recipient only receives one instead of two. I don't believe that is an error though -most likely a spam prevention function of the mail server (why send the same email twice to the same recipient in a message -also verified the same behavior through the mail server's web mail interface).

You could check the message queue to verify the cc and bcc addresses have been added to the queued message (uncheck the setting "Load not sent emails only:" before loading the messages to see previously sent messages). You could also debug the SendEmail method (line 2424) in Libraries\Nop.BusinessLogic\Messages\MessageService.cs to watch the message being sent by SendQueuedMessagesTask.

.
9 years ago
kakoli wrote:
Hi mb

Please help me with this error..

I did exactly everthing as per readme file getting this error now..



Line 1:  <%@ Page Language="C#" MasterPageFile="~/MasterPages/ThreeColumn.master" AutoEventWireup="true"
Line 2:      CodeBehind="RequestQuote2.aspx.cs" Inherits="NopSolutions.NopCommerce.Web.RequestQuote2Page"%>
Line 3:  

Click here for live example
Somebody please help :(


Have you compiled the solution?

After compiling the solution, you will need to upload the new page (RequestQuote2.aspx), new control (RequestQuote2.ascx to modules folder), and the updated assemblies (Nop.BusinessLogic.dll and NopCommerceStore.dll to the bin folder).

.
9 years ago
Yes! have done that and without any errors :( should i try again?
9 years ago
Did that again... for no fun, can you give me .dll of your?
9 years ago
Hey mb

Thanks for your help, seems like some progress, I didnt all that once again as per the readme, now getting this erro..

Parser Error
Description: An error occurred during the parsing of a resource required to service this request. Please review the following specific parse error details and modify your source file appropriately.

Parser Error Message: The server tag is not well formed.

Source Error:


Line 32: <asp:TextBox runat="server" SkinID="ForumSearchText" CssClass="forumsearchtext"/>
Line 33: <asp:TextBox runat="server" SkinID="ForumSearchBoxText" CssClass="forumsearchboxtext"/>
Line 34: <asp:TextBox runat="server" SkinID="BBEditorText" CssClass="bbeditortext
Line 35: <asp:TextBox runat="server" SkinID="RequestQuote2EnquiryText" Height="150px" Width="400px"/>
9 years ago
Hey mb

Its now working after i comment this in skin file of my theme, not sure if is needed, and why there is error coz of this..


<%--<asp:TextBox runat="server" SkinID="BBEditorText" CssClass="bbeditortext/>--%>

Also is there way I can add a request a quote button on product details page below add to cart?
9 years ago
mb wrote:
The code you posted looks like a mix of RequestQuote and RequestQuote2; you can remove the following from the code you posted as it's not being used (it is used by MessageService.SendEmail in RequestQuote2):
List<string> bcc = new List<string>();
foreach (string str1 in bccEmails.Split(new char[] { ';' }, StringSplitOptions.RemoveEmptyEntries))
{
    bcc.Add(str1);
}
List<string> cc = new List<string>();
foreach (string str1 in ccEmails.Split(new char[] { ';' }, StringSplitOptions.RemoveEmptyEntries))
{
    cc.Add(str1);
}
I tested the code you posted (with your settings names -different emails) and found no problems with it. I debugged the SendQueuedMessagesTask and it is working as it should -all email address are set for the message as they should be. I did notice that if an email message is specified twice in all the addresses (e.g. in TO and in BCC), the recipient only receives one instead of two. I don't believe that is an error though -most likely a spam prevention function of the mail server (why send the same email twice to the same recipient in a message -also verified the same behavior through the mail server's web mail interface).

You could check the message queue to verify the cc and bcc addresses have been added to the queued message (uncheck the setting "Load not sent emails only:" before loading the messages to see previously sent messages). You could also debug the SendEmail method (line 2424) in Libraries\Nop.BusinessLogic\Messages\MessageService.cs to watch the message being sent by SendQueuedMessagesTask.


Hi mb,

If I remove this then I can only use 1 email address in bcc and cc, I think by this code I can use more than 1 email addresses in cc and bcc which will be separated by a semi colon ";", am I correct ?
List<string> bcc = new List<string>();
foreach (string str1 in bccEmails.Split(new char[] { ';' }, StringSplitOptions.RemoveEmptyEntries))
{
    bcc.Add(str1);
}
List<string> cc = new List<string>();
foreach (string str1 in ccEmails.Split(new char[] { ';' }, StringSplitOptions.RemoveEmptyEntries))
{
    cc.Add(str1);
}


I have double checked that I am not repeating email addresses , to contains 1 email, bcc has 2 and cc has 1.

You also mentioned that the above code i's not being used (it is used by MessageService.SendEmail in RequestQuote2) - Does that means that for using this code I have to use those 2 extra .cs files that you included in  the project (for Bussiness logic / Messages Folder)
If I do not use  those 2 .cs files then this above code will not work ?
9 years ago
many times I tested the code and it seems that

- when I fill all the TO, BCC, CC with 1 email address each - it works fine

- when I fille bcc or cc with 2 email addresses separated by ";" then only 1email gets the message/email from the quote form but e-mail address after ";" don't get any kind of message or quote email

plz help
9 years ago
super wrote:

Hi mb,

If I remove this then I can only use 1 email address in bcc and cc, I think by this code I can use more than 1 email addresses in cc and bcc which will be separated by a semi colon ";", am I correct ?
List<string> bcc = new List<string>();
foreach (string str1 in bccEmails.Split(new char[] { ';' }, StringSplitOptions.RemoveEmptyEntries))
{
    bcc.Add(str1);
}
List<string> cc = new List<string>();
foreach (string str1 in ccEmails.Split(new char[] { ';' }, StringSplitOptions.RemoveEmptyEntries))
{
    cc.Add(str1);
}


I have double checked that I am not repeating email addresses , to contains 1 email, bcc has 2 and cc has 1.

You also mentioned that the above code i's not being used (it is used by MessageService.SendEmail in RequestQuote2) - Does that means that for using this code I have to use those 2 extra .cs files that you included in  the project (for Bussiness logic / Messages Folder)
If I do not use  those 2 .cs files then this above code will not work ?


The code I mentioned to remove is not being used by the code you posted, your CC and BCC email addresses are loaded from settings and are stored in variables ccEmails and bccEmails which are then passed to InsertQueuedEmail.
string ccEmails = SettingManager.GetSettingValue("RecipientThird.ccEmails", String.Empty);
string bccEmails = SettingManager.GetSettingValue("RecipientSecond.bccEmails", String.Empty);

// code removed

this.MessageService.InsertQueuedEmail(5, from, to, ccEmails, bccEmails, subject, body2,
    DateTime.UtcNow, 0, null, emailAccount.EmailAccountId);


If you are using RequestQuote2 (the form that allows attachments) in your project, then you need to include MessageService_Mod.cs and IMessageService_Mod.cs in the Nop.BusinessLogic project as they provide a new method to send an email message with attachments.

.
9 years ago
If I am NOT using RequestQuote 2 then how I can fix this code to use cc and bcc in which I can save number of email addresss in cc bcc separated by ";" ?