This method is deprecated! Please move over to the new repo here.
This script is required to connect a MyMail installation with the Envato API to download templates directly into MyMail. It allows to verify your buyers via your Envato app to download the package via the API.
To make this work you must have a working MyMail template zipped in you download package you upload to ThemeForest. Check the docs how to prepare your template to work with MyMail. It must be one zip file containing all your template files. The zip file must contain the word mymail in it's name.
Working examples:
- your_template_name_for_mymail.zip
- mymail_template.zip
- mymail.zip
Not working examples:
- your_template_name.zip
- MyMail_template.zip
- my_mail_template.zip
- Copy the entire folder to an directory on your server which is accessible via http like
http://example.com/mymail-template-activation
/. - Rename the
config.sample.php
toconfig.php
. - Go to the Manage apps page on Envato and "Register a new app".
- Call it something like "Your Name MyMail templates".
- As "Required permissions" select "Download the user's purchased items"
- Enter as "Confirmation URL" the location of this script like
http://example.com/mymail-template-activation/
. - Click on "Register App".
- Copy you "Secret Application Key" into the
config.php
file atSECRET_APP_KEY
. - Copy the "OAuth client ID" of your app into the
config.php
file atCLIENT_ID
.
To add your items you need to modify the config.php
file.
- replace the
999999
and the111111
with the Envato item id of your template. - change the values of
name
,description
,author
,author_url
andversion
If you have multiple items just reproduce the steps for a new item in this array like
$items = array(
999999 => array(
'name' => 'Template name'
'description' => 'This is the Description',
'author' => 'the author',
'author_profile' => 'https://example.com',
'version' => '1.0',
),
111111 => array(
'name' => 'Template name'
'description' => 'This is the Description',
'author' => 'the author',
'author_profile' => 'https://example.com',
'version' => '1.0',
),
);
To make sure everything is working set the DEBUG
constant in the config.php
to true
and visit http://example.com/mymail-template-activation/
in your browser.
Please check if your "Redirect URL" is equal to the one you have defined in your Envato App. If not uncomment the REDIRECT_URL
constant in the config.php
and past the exact URL. (watch for trailing slashes!)
set the DEBUG
value back to false
to prevent output of sensitive information!
Please use this form to submit your data
For the final step it's required to send me some information about your templates so I can add them to the list of available templates. For this information I need following info:
The name of your template. Max 30 Characters. No HTML tags allowed
The URL to an image of your template with dimensions of 300x225 (600x450 for HighDPI)
A short description of your templates. Allowed HTML tags are <a>
and <strong>
(don't abuse)
The website user can purchase the template. MyMail will add utm_source=MyMail+Templates+Page
to this URL for Google Analytics tracking. add the other parameters if needed.
Your endpoint you have defined about (http://example.com/mymail-template-activation/
)
The ID of your template on the Envato marketplace.
Please use this form to submit your data
I will check your information and will update you when the information has been added. It will take up to 24 hours to be visible on the templates page of all users.
If you have more questions you can contact me via my knowledge base or via my Envato profile.
Unfortunately no. Envato doesn't provide a sandbox with their API so the only way to test it is to purchase your plugin with another account. If you're in contact with me I'm surely help you out and get a copy of one of your items for testing.
The user will get a notification like "This is not a valid MyMail template" and will maybe blame me for that issue. I'll remove your item from the list if you don't fix it.
MyMail checks for new version of the templates once a day. If the provided version from your endpoint is higher than the users version MyMail will show an update notification. Users need a valid purchase of your item to get the update! Update the version number only when the update is available on ThemeForest. Otherwise people will get an older version.
If MyMail cannot check for newer versions on your endpoint or your server responds with an unexpected result it will hide the template. As soon it's available again it will show up on the template section.
MyMail checks the content of the zip and removes all files which are not html, image files or a colors.json. If I notice such a behavior I will permanently ban you from the list of available template.
More competition means more value for buyers. At the end of the day they are who pay our bills. Other than that I know many developers and template designers have more things to offer that I can do. It's also a good advertisement for MyMail if your template offers support. It's win-win-win in my opinion.