Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.
+3 votes
in Q2A Core by
edited by

Hai Everyone,

I need to change the ugly look of email template of all mails which generated from my q2a site. I need create an simple my own email template. Which file I needed to edit?


EDIT ON 30.10.2014

I mean the email template will display by a specific layout using html. and there is an logo which might be need to display on top of the mail. Example of email template screensshot is shown below. .


Please help me as soon as possible.


Q2A version: version 1.6.3
Thanks for the reply  :)

I will try. Its a plugin right?
I tried but the template never affected. Actually The all generated mails will follow this new email template. right?
Please help
I have tested it on a 1.6.3, it works...
I checked the term and saved in plugin section. But when the user still getting mail notification as default template. Any settings needed?
Please help
do you see the default html generated by the plugin inside the body field of the options ?
Make some tests using the
Admin-->Mailing--->"Send test to me"
Yes I noticed the html generated by the plugin inside the body textarea.

But there is no option for testmail to me.
There is only one checkbox with this option " Enable mass mailings to all users  ". So how can I test the mail
After you check the option " Enable mass mailings to all users  ", scroll down the page, you'll see the "Send test to me" button too :-)
Yes THanks :)

so we can customize and save the template right?

Is this template will used for all the notification mail? Like question asked and answered etc.
> so we can customize and save the template right?
yes, in the "body" field of the plugn, but first you must make it work :-)
> Is this template will used for all the notification mail? Like question asked and answered etc.

of course, I'm not talking of the Admin-->Mailing function, but of the "Email formatting" plugin
Attached the email that I receive with the default template :
@maxjtechno thanks again :)

I customized the mail template. And it's working well...

How can I give you best answer ;)

Your thanking is already more than ok  :-) :-)
The important thing is you've solved your issue...

2 Answers

0 votes

Mail texts are stored in qa-include/qa-lang-emails.php. They should support HTML in them which would be enough to make something more appealing.

Of course, you should edit the qa-lang-emails.php for your language file, if any. Or if you are using the default language then you can create the file qa-lang/custom/qa-lang-emails.php by copying the one in qa-include and customize it your own.

Yes, it should. However, bear in mind you need to escape the quotes inside the quotes. For example, instead of:

You should use this:
But it doesn't works for me
My code is below

        'q_answered_body' => "<html><body  style='background-color:#FFE6FF'><table width=\"765\" border=\"0\" align=\"center\" cellpadding=\"0\" cellspacing=\"0\" style=\"border: 1px solid #B5EBDB\"><tr>
        <td background=\"http://reasonablespread.com/spreadresource/template/email/43/images/BusinessBasic_03.jpg\">&nbsp;</td>
        </tr><tr style=\"background-color:#FCC\"><td style=\"background-color:#FFC\">
        Your question on ^site_title has been answered by ^a_handle:\n\n^open^a_content^close\n\nYour question was:\n\n^open^q_title^close\n\nIf you like this answer, you may select it as the best:\n\n^url\n\nThank you,\n\n^site_title
        'q_answered_subject' => 'Your ^site_title question was answered',

in qa-include/custom/qa-lang-emails.php
A few comments.

1. "it doesn't works for me" is like going to the doctor and say "I'm not feeling well, what should I take?" :)

2. You have syntactical errors in your pasted code, eg: style='background-color:#FFE6FF'

3. You should test your HTML code in a browser first. Create a file in your desktop, put the content in it, check it looks good. Then try to add it to the email string. Each email server processes HTML files differently. I've seen some that expect you to add "<html><body>" while others don't. There is a lot of trial and error here. But that is absolutely unrelated to Q2A.
Thanks for the reply :)
I will try
0 votes
It may be over spec for you. But, "Notification Pro" has its feature (Conversion to multipart email + Customizable email template). The default template is the template of popular mailchimp. If you have HTML and CSS knowledge, you are free to customize HTML email.
Excerpt of the user's manual:
File extension
  *.txt: Template for plain text part
  *.html: Template for HTML text part
  *.css: Style for HTML text part
File explanation of main part
  main.html: Template of basic part applied to all emails
  style.css: Style applied to all emails
Conversion rule of main part
  [title]: Converted to “mail title”
  [style]: Converted to contents in “style.css”
  [site_url]: Converted to “site URL”
  [site_title]: Converted to “site title”
  [headerContent]: Converted to “images/eyecatch_600px.png”
    This is commented with initial state.
  [body]: Converted to email content
  [unsubscribe]: Converted to “unsubscribe link”
    This is displayed only in the case of email sent by NP.