add an upload file feature to the contact us page

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
3 years ago
Yidna wrote:
You are calling SendContactUsMessage(...
which in turn calls              
return SendNotification(messageTemplate, emailAccount, languageId, tokens, toEmail, toName,
                    fromEmail: fromEmail,
                    fromName: fromName,
                    subject: subject,
                    replyToEmailAddress: senderEmail,
                    replyToName: senderName);

but it does not pass in the attachment details in the parameters

        public virtual int SendNotification(MessageTemplate messageTemplate,
            EmailAccount emailAccount, int languageId, IEnumerable<Token> tokens,
            string toEmailAddress, string toName,
            string attachmentFilePath = null, string attachmentFileName = null,
            string replyToEmailAddress = null, string replyToName = null,
            string fromEmail = null, string fromName = null, string subject = null)
        {

Is your file being uploaded to the server – can you see it - in what directory ?

You need to provide the attachmentFilePath and read more here attachmentFileName to SendNotification if you are going to use that method


Thanks for the upvote and actualizing info1
3 years ago
mhsjaber wrote:
1. Add encryption type (enctype="multipart/form-data") to contact us form.
2. Add file input field inside the form.
3. Get your file in ContactUs action method of CommonController.
var httpPostedFile = Request.Form.Files.FirstOrDefault();


how do I attach the file?
3 years ago
See where the PDF is attached to Order Placed Email
See protected virtual void SendNotificationsAndSaveNotes(Order order)
and SendOrderPlacedCustomerNotification(...)
in Source43\Libraries\Nop.Services\Orders\OrderProcessingService.cs
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.