Add subject field in the contact us form in nopCommerce?

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
8 anni tempo fa
I would like to add another two / three new fields to the contact form to the default ones (name / email / object / Enquiry). nopcommerce3.7 use
8 anni tempo fa
Hi.
Just add your new fields in the ContactUsModel and then use them in \Presentation\Nop.Web\Views\Common\ContactUs.cshtml.
8 anni tempo fa
If you use any theme then you need to go Presentation==>Nop.Web==>Themes==>yourview==>Views==>Common==>ContactUs.cshtml
8 anni tempo fa
ok .. thanks @RomanovM, @ sina.islam are not very practical in programming.
In the Meantime I did this send-mail.schtml (From Action= Send-mail.schtml by form conctactus)
******************************
@{
    var Name = Request["Name"];
    var Azienda = Request["Azienda"];
    var Indirizzo = Request["Indirizzo"];
    var Cap = Request["Cap"];

    var Citta = Request["Citta"];

    var Email = Request["Email"];
    var Tel = Request["Tel"];
    var Richiesta = Request["Richiesta"];


    var errorMessage = "";
    var debuggingFlag = false;
    try
    {
        // Initialize WebMail helper
        WebMail.SmtpServer = "smtp.xxxxxxxit";
        WebMail.SmtpPort = 25;
        WebMail.UserName = "[email protected]";
        WebMail.Password = "xxxxxxxxxxxx";
        WebMail.From = "[email protected]";
        

        // Send email
        WebMail.Send(to: "[email protected]",
            subject: "Richiesta Informazioni da [email protected] - " + Name ,
            body: "<strong>Nome: </strong>" + Name + "<br><strong> Azienda: </strong>" + Azienda + "<br><strong> Indirizzo: </strong>" + Indirizzo + "<br><strong> Cap :</strong>" + Cap + "<br><strong>Città : </strong>" + Citta + "<br><strong> Email: </strong>" + Email+ "<br><strong> Tel: </strong>" + Tel + "<br><strong> Richiesta: </strong>" + Richiesta
           ,from:"[email protected]",bcc:"[email protected]" );
      
   }
    catch (Exception ex)
   {
        errorMessage = ex.Message;
   }
}
<!DOCTYPE html>
<html>
<head>
    <title>Richiesta Info</title>
</head>
<body>
    <p>Gentile <b>@Name</b> </p>
    @if (errorMessage == "")
    {
        <p>
            <strong>Email inviata Correttamente</strong>
        </p>
        <p>Riepilogo :<br />  @Name <br />
           @Azienda <br />
           @Indirizzo <br />
           @Cap <br />
           @Tel <br />
          
        <b> @Richiesta</b></p>
    }
    else {
        <p><b>Email <em>non è</em> stata inviata.</b></p>
        <p>
            problemi sul smtp
        </p>
        if (debuggingFlag)
        {
            <p>Errore:</p>
            <p><em>@errorMessage</em></p>
        }
    }
</body>
</html>
************************************************

ERROR:

System.Web.HttpException (0x80004005): 'The path'/Send-mail.cshtml' is not allowed. in System.Web.HttpForbiddenHandler.ProcessRequest(HttpContext context) in System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() in System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)

++++++++++++++++++++++++++++++++++++++
Why???
8 anni tempo fa
Help me?v :-(
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.