Jump to content
  • 0

Class Emailgroups


NETLINK

Question

Hey!
 
Is the EmailGroups::add( array $vars ) method not supported for modules?

One of the vars is:

"plugin_dir The directory where the plugin resides that is associated with this email group (optional)"

I'm guessing that's where it loads the language file from?

I was able to create an email template from a module, but the template name and description are blank in Settings->Emails->Email Templates
/admin/settings/company/emails/templates/

Link to comment
Share on other sites

2 answers to this question

Recommended Posts

  • 0

Custom emails are not intended to support modules. plugin_dir is the relative path to the plugin from Blesta's plugin directory. Since modules are not defined within that context, the email group would not be loaded, such as the language, as you've noticed. It may not be possible to receive BCC notices to the email either.

 

It may be better to either create a plugin to handle emails instead, or update the module to send a custom email without saving it as an email template.

Link to comment
Share on other sites

  • 0

I realised this eventually.

 

I was working on the Universal Domains modules, which registers domains that can't be registered through a live API. Like some ccTLDs. And I got a feature request to send an email notification when a client updates the nameservers for a domain (since it's not live, an admin would have to update them manually).

 

I thought if I could create an email template, then various admins could subscribe to the notice. It worked as far as getting the template and the notice registered, but the labels were left blank. So, what I did in the end was, I added a field in the module management were an admin can enter their support email address. If that's set, then the nameserver tab will have active form fields, with the nameservers, which can be updated. When updated, an email notification is sent to the support address using Emails::sendCustom() and a client note is added so that the request can be verified.

 

If the support address is not set, then the nameservers tab just shows a static page with the live nameservers. I thought this was an acceptable workaround.

 

https://github.com/NETLINK/Blesta-UniversalDomains

Link to comment
Share on other sites

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...