Jump to content
  • 0

Universal Module - How To Specify Action In Body Of E-Mail?


AdamDG

Question

I am using the universal module to send an e-mail to our administrators whenever a service needs to be modified.  I cannot figure out how to specify the action to take (add, edit, suspend, unsuspend, cancel, renew, package change) in the body of the e-mail notification.  I would like a simple e-mail notification that goes something like this:

 

Subject: Acount Admin Action Required

Body: Please {action} the hosting account: {username}

 

This seems so simple, but there does not appear to be a variable that describes the action to be taken that can be parsed by the e-mail template system.  I assume there is a really simple answer to this.  Thanks in advance!

Link to comment
Share on other sites

14 answers to this question

Recommended Posts

  • 0

The email is sent when the action takes place (e.g. when the service is added), and includes the package/service meta fields set for the universal module product. The action itself (add/edit/cancel, etc.) isn't included as an available tag. You can view all available tags using the {% debug %} tag in the template and sending yourself an email by performing one of the actions.

Link to comment
Share on other sites

  • 0

I am trying to use the Universal Module to facilitate automated billing, including suspension and unsuspension, of services that need to be manually provisioned / maintained.  If the system can't tell me what action to take when it notifies me that an action needs to be taken, how would I accomplish this?

Link to comment
Share on other sites

  • 0

I am trying to use the Universal Module to facilitate automated billing, including suspension and unsuspension, of services that need to be manually provisioned / maintained.  If the system can't tell me what action to take when it notifies me that an action needs to be taken, how would I accomplish this?

 

Have you looked at notifications? http://docs.blesta.com/display/user/Universal+Module#UniversalModule-Notifications

 

This would allow you to be notified, by putting in your email, or URL to a separate system when an action occurs on the service.

Link to comment
Share on other sites

  • 0

That is exactly what I am trying to do.  The problem is that when the notification is sent to me, I have no way to know what action is to be taken, because the body of the e-mail is exactly the same regardless of the action being taken.

 

Ah, there should probably be some better documentation on this. Have you tried adding the {% debug %} tag to the email notification for the Universal Module Product? It should contain the action, and if it doesn't we'll need to correct that. I'll see if I can take a deeper look at it in a little bit.

 

Right now someone in the building must be spraying perfume in the vents because I can taste it. :(

Link to comment
Share on other sites

  • 0

Yes, I tried the {% debug %} tag.  The output does not appear to contain the action.  It does contain the values of the service options fields that I have defined for the product, which is great.  I also does not contain the product name, which although not essential, would be convenient.  Here's an example of what I see ("****" censoring domain names):

Array(    [h2o] => H2o_Info Object        (            [h2o_safe] => Array                (                    [0] => filters                    [1] => extensions                    [2] => tags                )            [name] => H2o Template engine            [description] => Django inspired template system            [version] => 0.3        )    [base_uri] => ****/    [admin_uri] => ****/admin/    [client_uri] => ****/client/    [email_address] => billme@adamtestcompany.com    [emailfilterlevel] => disabled    [password] => asdf    [_other] => )
Link to comment
Share on other sites

  • 0

I also have a related, but much more general question about e-mail template tags.  We are interested in creating some tags that can be included in any client e-mail template that contain information specific to our application, that would come from our own database queries.  How practical is this?  What would be the suggested method of implementing this?  We are OK with making modifications to the core of our Blesta installation, although we try to limit doing so as much as possible.

Link to comment
Share on other sites

  • 0

I also have a related, but much more general question about e-mail template tags.  We are interested in creating some tags that can be included in any client e-mail template that contain information specific to our application, that would come from our own database queries.  How practical is this?  What would be the suggested method of implementing this?  We are OK with making modifications to the core of our Blesta installation, although we try to limit doing so as much as possible.

 

You could use vQmod to modify Blesta without making core changes. In any case, you can update the Emails model (/app/models/emails.php) to set default tags that will apply to all emails sent. A few already exist, so it should be straight-forward for a developer to add others to your installation.

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