Jump to content
  • 0

How setup name and description for custom email templete in module?


Maciej Sza

Question

I added custom email template for my module:

                $group = [
                    'action'     => 'certificate_generate',
                    'type'       => 'client',
                    'plugin_dir' => null,
                    'tags'       => '{first_name},{last_name},{package_name}',
                ];

                if ($groupId = $module->EmailGroups->add($group)) {
                    $email = [
                        'email_group_id' => $groupId,
                        'company_id'     => isset($_SESSION['blesta_company_id']) ? $_SESSION['blesta_company_id'] : 1,
                        'lang'           => 'en_us',
                        'from'           => 'no-reply@mydomain.com',
                        'from_name'      => 'Blesta Order System',
                        'subject'        => 'SSL Certificate',
                        'text'           => 'Hi {first_name}, Now you are able to generate your certificate. Login to your account and process with Certificate Configuration',
                        'html'           => '<p>Hi {first_name},</p><p>Now you are able to generate your certificate. Login to your account and process with Certificate                     Configuration</p>',
                    ];

                    $module->Emails->add($email);
                    
Template created successfully but I don't know how setup name and description in admin area email templates list.
I try added files in directories
..modules/mymodule/language/en_us/admin_company_emails.php
..modules/mymodule/language/de_de/admin_company_emails.php

$lang['AdminCompanyEmails.templates.certificate_generate_name'] = 'SSL Certificate';
$lang['AdminCompanyEmails.templates.certificate_generate_desc'] = 'Notice sent that the client is able to generate and configure a certificate.';

Unfortunately this solution is not working.

Link to comment
Share on other sites

0 answers to this question

Recommended Posts

There have been no answers to this question yet

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...