Request Quote Form (for 1.80 and 1.90)

9 years ago
super wrote:
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

I was not able to reproduce your problem with the code you provided, I was able to send to multiple BCC recipients. You will need to debug the SendEmail method I mentioned in a previous post to see if the email addresses have been added to the message object.

.
9 years ago
sorry for the confusion. (let's assume I am not using RequestQuote2 at all in my project and I don't have those 2 .cs files in Business logic location)


If I just want a request quote page to send e-mail to other recipients other than store owner -

so mb according to you If instead of this
:

string ccEmails = SettingManager.GetSettingValue("RecipientThird.ccEmails", String.Empty);
                    string bccEmails = SettingManager.GetSettingValue("RecipientSecond.bccEmails", String.Empty);

                    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);
                    }

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



If I use this:

string ccEmails = SettingManager.GetSettingValue("RecipientThird.ccEmails", String.Empty);
                    string bccEmails = SettingManager.GetSettingValue("RecipientSecond.bccEmails", String.Empty);

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


Still I should be able to send e-mail and save multiple e-mail addresses in bcc and cc seperated by ";" ?
Because I think the code that I have removed above "List<string> bcc = new List<string>" is sending e-mail to all the email addresses which are seperated by ";" sign and if I remove this code then how code will know that if ";" comes then there is new email address after that I mean the code will use semi colon sign as part of the email address like this [email protected]; which again will give an error saying un-available mailbox ?

plz correct me if I am wrong.

-------------------------------------MORE-----------------------------------

mb wrote:

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);



Isn't the variables "ccEmails" and "bccEmails" being used here:

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);
                    }


-------------------------------------MORE-----------------------------------

to make use of that removed code if instead of using:


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


I use this:


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


It gives me error by underlying the line of code
9 years ago
super wrote:
sorry for the confusion. (let's assume I am not using RequestQuote2 at all in my project and I don't have those 2 .cs files in Business logic location)


If I just want a request quote page to send e-mail to other recipients other than store owner -

so mb according to you If instead of this:

string ccEmails = SettingManager.GetSettingValue("RecipientThird.ccEmails", String.Empty);
string bccEmails = SettingManager.GetSettingValue("RecipientSecond.bccEmails", String.Empty);

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);
}


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



If I use this:
string ccEmails = SettingManager.GetSettingValue("RecipientThird.ccEmails", String.Empty);
string bccEmails = SettingManager.GetSettingValue("RecipientSecond.bccEmails", String.Empty);

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


Still I should be able to send e-mail and save multiple e-mail addresses in bcc and cc seperated by ";" ?
Because I think the code that I have removed above "List<string> bcc = new List<string>" is sending e-mail to all the email addresses which are seperated by ";" sign and if I remove this code then how code will know that if ";" comes then there is new email address after that I mean the code will use semi colon sign as part of the email address like this [email protected]; which again will give an error saying un-available mailbox ?

plz correct me if I am wrong.

The code (underlined above) is not needed because all it is doing is splitting the ; separated list of BCC and CC addresses and loading it into variables cc and bcc (of type List<string>). These variables are not used which is why you can remove the code block. Your CC and BCC addresses will be stored in ccEmails and bccEmails (after loading them from settings "RecipientThird.ccEmails" and "RecipientSecond.bccEmails"). ccEmails and bccEmails are then passed to InsertQueuedEmail.

Have you verified the format of "RecipientThird.ccEmails" and "RecipientSecond.bccEmails"? Their values should be semicolon separated like the following:

[email protected]; [email protected]; [email protected]



super wrote:

-------------------------------------MORE-----------------------------------

[...]

Isn't the variables "ccEmails" and "bccEmails" being used here:

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);
}

Yes they are used here, but only to add entries to variables bcc and cc (variables that are never used later).

super wrote:

-------------------------------------MORE-----------------------------------

to make use of that removed code if instead of using:


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


I use this:


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


It gives me error by underlying the line of code


You can't use cc and bcc here because the method InsertQueuedEmail doesn't take a List<string> for CC or BCC addresses. The method InsertQueuedEmail is not actually sending the email, it is inserting it into the message queue (table: Nop_QueuedEmail). The queue is then loaded from the table by a task SendQueuedMessagesTask (configured in web.config). This task will take the semicolon separated cc and bcc strings from the message it loaded list and create List<string> variables to hold the CC and BCC addresses. The task will then send the message using method MessageService.SendEmail (using the List<string> cc and bcc variables it creates).

.
9 years ago
thank you mb for all the explanation and for your time - I deeply appreciate it...
(I have removed that part of code and now it seems to be working fine)
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
Hi

Everthing seems to be fine now finally.. but when i populate all the fileds and click sumit, all the fileds get reset as if it sent details, but i dont recive any mail to any of my sotre ids, nighter is there any confirmation saying your request is sent or something like that.. pelase advise.
9 years ago
Everthing is up and working, just recently i ran into a peculiar issue. I chnaged my site theame and now when i click on request a quote it opens up in  a old theame, any help on this would be really appriciable.
9 years ago
kakoli wrote:
Everthing is up and working, just recently i ran into a peculiar issue. I chnaged my site theame and now when i click on request a quote it opens up in  a old theame, any help on this would be really appriciable.


This is a bug in the request quote form for 1.90. The downloads (RequestQuote and RequestQuote2) for 1.90 on the first page of this topic have been updated and are also available below.

Updated Downloads:
http://www.mediafire.com/file/arpa7b710a2gl4c/RequestQuote_190_updated.zip
http://www.mediafire.com/file/8xman3r1pcrfezo/RequestQuote2_190_updated.zip

---

To fix, edit files: RequestQuote.aspx.cs and RequestQuote2.aspx.cs

change line 20 from:
public partial class  RequestQuotePage : BaseNopPage

to the following:
public partial class RequestQuotePage : BaseNopFrontendPage

---

Edit files: Modules\RequestQuote.ascx.cs (line 26) and Modules\RequestQuote2.ascx.cs (line 29)

change from:
public partial class RequestQuoteControl : BaseNopUserControl

to the following:
public partial class RequestQuoteControl : BaseNopFrontendUserControl

You will need to recompile the NopCommerceStore project and upload the NopCommerceStore.dll assembly to your site.

.
8 years ago
Can anyone help with the request quote form  for 2.0 ?
8 years ago
pepper wrote:
Can anyone help with the request quote form  for 2.0 ?


I've completed a Request Quote Form plugin for NC2.0 and a tutorial for developers to write their own. The plugin is pending approval, but the tutorial is available at http://csharpwebdeveloper.com/writing-nopcommerce-2-plugin.