netorica Posted February 24, 2020 Report Posted February 24, 2020 I can't seem to find a tutorial where in I can learn how to add email templates here admin/settings/company/emails/templates/ Can you also teach me how to send emails using a template. I will be doing it in a plugin approach. Thank you for the response Quote
Tyson Posted February 24, 2020 Report Posted February 24, 2020 You can send email in multiple ways through a plugin, such as via a cron task or view a controller action in the UI. If you want your plugin to create email templates, you need to create an email group and an email template for that group during your plugin's Install and/or Upgrade methods. Be sure you also remove those email templates/groups on uninstall. It's the plugin's responsibility to manage its own data. I recommend you take a look at an existing plugin's source code to see what a working implementation looks like, such as the Support Manager plugin. Quote
netorica Posted February 26, 2020 Author Report Posted February 26, 2020 Thank you for the lead I have successfully created an email template and sent it by using this code $this->Emails->send('Verifyemail.request_verify', Configure::get('Blesta.company_id'), null, $email, $tags); Now my question is why it doesn't log on the Email Log of the client? Quote
Jono Posted February 26, 2020 Report Posted February 26, 2020 I believe this can be accomplished through the $options parameter for Emails::send(). Specifically you'll need to determine to which client the email belongs and set $options['to_client_id'] = $client->id; Quote
netorica Posted February 29, 2020 Author Report Posted February 29, 2020 Thank you very much Jono 1 Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.