[TUTORIAL] How to customize your emails
Hi, I searched a lot but didnt' found nothing.
But finaly I found the solution!
This is a little "HowTo"
But you should know, I don't speak english very well, so please don't laught about me
Step one
Open your Filezilla or other FTP software to archive this file "aplications/dashboard/locale/en-CA/definitions.php"
Step two
Now copy the file and open with PHP editor like "Notepad ++, Dreamviewer, etc"
Step three
Find this:$Definition['EmailConfirmEmail'] = 'here is some text';
Here you can replace what you want. But don't forget the confirmation link!
I don't know all definitions for email, so please post other definitions
You can make a HTML email!
You can make it on the easy way or hard.
Easy way
You can search in your email for a HTML email.
In google chrome, you can see the source code. Right click on the header and Inspect Element.
In the tab Elements you can move your mouse up and down, and you will see, the webpage will mark blue. Search the whole email. Click on that and Copy as HTML.
Now you can open Dreamviewer and paste the HTML code into a empty Document.
If you click on "Design" tab in Dreamviewer, you can make your changes without writing code.
Then, copy the Code (do not copy this:
` <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
Untitled Document
`
You don't need it.
Insert like here
$Definition['EmailConfirmEmail'] = ' <body>Your code';
Now the hard way
For this I made a videotutorial. At the end of the video you can see how to paste the code in Definitions.php
https://www.youtube.com/watch?v=LnwzQ8_VaUY
I hope, I could help you!
Comments
just a slight change
in
conf/
create a file calledlocale-email.php
this makes it update friendly.
grep is your friend.
Aslo external images are often blocked for privacy reasons. Embedded images can result is higher spam score, and don't always work.
Aslo work on getting size down. Email, isn't really supposed be a browser experience.
You can create that gradient in css, and use a serif font for the Name an tagline. It doesn’t have to be exactly the same, it just has to be comparable.
grep is your friend.
Thank you @x00!
Yes, images are blocked but maybe somebody want it
Do you know all definitions? Could you post it here?
Images not really necessary and you want it to gracefully degrade, try this
This will have more support across browsers. Being too tricksy in email can backfire, it was never really designed for html, keep thing simple.
grep is your friend.
http://www.colorzilla.com/gradient-editor/
Can I ask you how do you make this box with code inside?
this has most of the definitions (not addons)
https://www.transifex.com/projects/p/vanilla/resources/
if you are doing a full translation, create a proper locale pack (see docs).
grep is your friend.
This is awesome! If you want to document on the wiki, that would be great!
I agree that email is intended to be more content that style. I don't think a header image is overkill though.
Thanks again for the walkthrough, @DogHam
Search first
Check out the Documentation! We are always looking for new content and pull requests.
Click on insightful, awesome, and funny reactions to thank community volunteers for their valuable posts.
I don't know how to write in documents
@x00 the option with gradient don't work for me
I get error in definitions.php because this: `
It's in the gradient css style.
I don't know how to fix that, but it's not important.
you need to escape all ' on php single quoted strings.
http://php.net/manual/en/language.types.string.php
you could use Herdoc
Just remember you must have a newline before
EOF;
and there can't be any indent before it.grep is your friend.
You might want to divide up the content to keep it dry.
Then do each email definition.
grep is your friend.
There is actually important bits in the original code remember to include e.g.
grep is your friend.
Thank you you made it great.
I tryed it with your source code. I will receive a plain text email. No style, nothing.
This is what it deliver:
I will keep html code with tables. it's working.
But thank you for help!
hmm... this is down to FormatString removing between
{}
there is a way to escape thisthen
This is double escaped so make sure you are doing with
EmailTemplate
if you are just usingEmailConfirmEmail
it sould be single escaped{{}
not{{}{}
grep is your friend.
Thank you I will try
@x00 Do I have to point to the new file or is it supposed to overwrite automatically with the definition? Just did as it is, and no change at all.
try conf/locale.php possibly. since locale.php is no longer overwritten by upgrades.
when modifying locales or adding locale files - always clear the ini files in the /cache folder - for best results.
to see if you are reading the files you think you are reading for locales.
cache/locale_map.ini
if your locale file is not listed you are not reading it !
so if the cache/locale_map.ini
has this
and you are wondering why your definitions in conf/locale.php are not being read, it is because you need to delete the cache/locale_map.ini
it need to have something like this.... with the word "/conf/locale.php"
then you know vanilla is looking at that file.
you can always test if definitions to see if it is a problem with reading locale.php or a problem with the definition with a simple definition. to your conf/locale.php
$Definition['Howdy, Stranger!'] = "Greetings Earthling!";
then
it will change to
and you know your locale.php is being read and all your definitions added will work, provided the left hand side is correct.
http://vanillaforums.org/discussion/26597/tutorial-how-to-change-wording-how-to-change-text-how-to-change-language-how-to-change-locale
I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.