How to add a new message template?

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
10 yıl önce
[email protected] wrote:
Source code showing how to send an e-mail which is using a message template.
Thanks


Hi, please see the following sample code which uses for Welcome message for new Customer Registration

/// <summary>
        /// Sends a welcome message to a customer
        /// </summary>
        /// <param name="customer">Customer instance</param>
        /// <param name="languageId">Message language identifier</param>
        /// <returns>Queued email identifier</returns>
        public virtual int SendCustomerWelcomeMessage(Customer customer, int languageId)
        {
            if (customer == null)
                throw new ArgumentNullException("customer");

            var store = _storeContext.CurrentStore;
            languageId = EnsureLanguageIsActive(languageId, store.Id);

            var messageTemplate = GetLocalizedActiveMessageTemplate("Customer.WelcomeMessage", languageId, store.Id);
            if (messageTemplate == null)
                return 0;

            //tokens
            var tokens = new List<Token>();
            _messageTokenProvider.AddStoreTokens(tokens, store);
            _messageTokenProvider.AddCustomerTokens(tokens, customer);

            //event notification
            _eventPublisher.MessageTokensAdded(messageTemplate, tokens);

            var emailAccount = GetEmailAccountOfMessageTemplate(messageTemplate, languageId);
            var toEmail = customer.Email;
            var toName = customer.GetFullName();
            return SendNotification(messageTemplate, emailAccount,
                languageId, tokens,
                toEmail, toName);
        }
6 yıl önce
Hello Guys

i want to create a message template like this can you please help me. What i have to do .


https://snag.gy/emg91Q.jpg

waiting for your response

Thank you
6 yıl önce
ishpejti wrote:
Hello Guys

i want to create a message template like this can you please help me. What i have to do .


https://snag.gy/emg91Q.jpg

waiting for your response

Thank you


Hello,

You just need a HTML email design like the one you shared and code it in message template.

Thank you,
Atul
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.