News:

Wondering if this will always be free?  See why free is better.

Main Menu

Email Template Editor

Started by Matthew K., March 31, 2011, 10:56:52 PM

Previous topic - Next topic

marielle

Quote from: studiowi33 on July 25, 2011, 12:16:53 PM
This is great! Now all I need is a PM template creator.
As a workaround we're using the warning system for that purpose (with 0 warning points for a non-warning). Not ideal, but it does the trick.

treehugger

Am tidying my Admin.php file by manually adding mod changes to it and I need to make the following change:


Find: [Select]
'profile' => array($txt['custom_profile_shorttitle'], 'enabled' => in_array('cp', $context['admin_features'])),
),
),
Add After: [Select]

// Labradoodle-360; Email Template Editor
'emailtemplates' => array(
'label' => $txt['email_template_editor'],
'file' => 'EmailTemplateEditor.php',
'function' => 'ModifyEmailTemplates',
'icon' => 'application_view_tile.png',
),
// End Labradoodle-360; Email Template Editor


I assume that means drop the email editor code in BEFORE   'profile' => array etc. which would give me

),
'featuresettings' => array(
'label' => $txt['modSettings_title'],
'file' => 'ManageSettings.php',
'function' => 'ModifyFeatureSettings',
'icon' => 'features.gif',
'subsections' => array(
'basic' => array($txt['mods_cat_features']),
'layout' => array($txt['mods_cat_layout']),
'karma' => array($txt['karma'], 'enabled' => in_array('k', $context['admin_features'])),
'sig' => array($txt['signature_settings_short']),
// Labradoodle-360; Email Template Editor
'emailtemplates' => array(
'label' => $txt['email_template_editor'],
'file' => 'EmailTemplateEditor.php',
'function' => 'ModifyEmailTemplates',
'icon' => 'application_view_tile.png',
),
// End Labradoodle-360; Email Template Editor
'profile' => array($txt['custom_profile_shorttitle'], 'enabled' => in_array('cp', $context['admin_features'])),
),
),
'securitysettings' => array(
'label' => $txt['admin_security_moderation'],
'file' => 'ManageSettings.php',
'function' => 'ModifySecuritySettings',
'icon' => 'security.gif',
'subsections' => array(
'general' => array($txt['mods_cat_security_general']),
'spam' => array($txt['antispam_title']),
'moderation' => array($txt['moderation_settings_short'], 'enabled' => substr($modSettings['warning_settings'], 0, 1) == 1),
),
),


Is that really right, or should it go in AFTER  'profile' => array etc. please?

Matthew K.

You add
// Labradoodle-360; Email Template Editor
'emailtemplates' => array(
'label' => $txt['email_template_editor'],
'file' => 'EmailTemplateEditor.php',
'function' => 'ModifyEmailTemplates',
'icon' => 'application_view_tile.png',
),
// End Labradoodle-360; Email Template Editor

Right after'profile' => array($txt['custom_profile_shorttitle'], 'enabled' => in_array('cp', $context['admin_features'])),
),
),

Sorry for the confusion, hope this helps!

treehugger

Thank you for your quick reply Labradoodle -360. :)

I confuse easily and some mod writers say Before means After and other say After means After and guessing by deciding whether something 'looks' right doesn't always work - not for me anyway. ;D

Matthew K.

Not a problem treehugger.

And actually, if you follow the parser it's always "after" if it says "after" and same for before, the confusion is with the actual XML as it's reverse, search for "1" and add "2" BEFORE 1.

Enjoy!

treehugger

 :-[ :-[ :-[ It's taken me about three years to finally train myself to remember that Before means After -  :'( no wonder my mods are causing havoc!!

Matthew K.

Sorry to hear that, it does get quite confusing sometimes. But just remember the XML is backwards of what it sounds like, and the package parser parses it correctly.

dddphoto

When will this be able to work on ver 2.0.1?

Matthew K.

This should definitely work with 2.0.1 out of the box...using version emulate.

dddphoto

The auto loader won't work and when I go to parse the manual download instructions it says that it isn't compatible with this version. Not sure what you mean by version emulate.

supercar1000

Are you planning to include the HTML feature? Would be very useful...

Matthew K.

Possibly, the HTML formatting allowed in emails is limited, and it'd be tough to control.

BaghdadGhost

Hi all,

I am on smf 2.0.2 now

after emulating and installing without errors. when trying to access the set up option of this mod I get this error


Fatal error: Cannot redeclare template_add() (previously declared in /Themes/default/AutoRespond.template.php:18) in /Themes/default/EmailTemplateEditor.template.php on line 188

its not urgent but any help appreciated.



Matthew K.

Open ./Sources/EmailTemplateEditor.php
Code (Find) Select
$context['sub_template'] = 'add';
Code (Replace) Select
$context['sub_template'] = 'ete_add';


Open ./Themes/default/EmailTemplateEditor.template.php
Code (Find) Select
function template_add()
Code (Replace) Select
function template_ete_add()
Try that.

BaghdadGhost

thank you so much for the fast respond. that fixed the issue.

actually I forgot to mention earlier that I had it installed on my test forum (no mods installed) and all went well. but this forum was installed 2.0.2 right away unlike my active forum which was 2.0.1 then patched to 2.0.2

I even thought that it could be another mod installed and causing the conflict, therefore I uninstalled PM new members, yet did not fix the problem earlier. which made me wondering what is the real cause of it?

I mentioned the above to other members and mod author

thanks again

Matthew K.

The modification "AutoRespond" conflicts with Email Template Editor, apparently :)

Why? Because both of our modifications have "template_add"'s, which is dumb, function names should NOT be that generic. Whenever I get around to updating this modification, the problem will definitely be solved.

BaghdadGhost

aha never thought of this one which I have installed.

many thanks again

Matthew K.

Not a problem. :) Hope you enjoy it! I'll have to release an update soon...I was just looking at it yesterday and gosh is it OLD ;)

Dersim62

I love it! Thank you a lot!

But one thing it doesnt work! I can not put a picture, like a logo, in the editor. I thing that the html is set off.
Please can you tell me how to fix it? Just a normal picture in the header of the Editor (For example a welcome email).

Matthew K.

You are not able to put any HTML in the emails, unfortunately.

Advertisement: