Jump to content

Welcome Email And Getemailtags In Module


Blesta Addons

Recommended Posts

i want to include the package name in the welcome email , wich tag should i use ? {package.name} ?

 

the second question , is possible to add a returned data service creation in the welcome email tags without saving this data ?

 

exemple , in module addservice , i have the returned data from $response , the returned data has a lot of keys , and i want just to save 2 keys in the service field , and i want to use two more others key in welcome email tags without saving them in service fields .

// Return service fields
  return array(
   array(
    'key' => "my_data",
    'value' => (isset($response->my_data) ? $response->my_data : (!empty($vars['my_data']) ? $vars['my_data'] : null)),
    'encrypted' => 0
   ),
   array(
    'key' => "ip_address",
    'value' => isset($response->ipaddress) ? $response->ipaddress : null,
    'encrypted' => 0
   )
);

is this possible ?

Link to comment
Share on other sites

Yes mate {package.name} is the package name :)

The welcome email only has access to service fields that are saved. So if you want to send those other two fields, they need to be saved for the service. If they are not service-specific, you could set them on the package or module instead, if that would make sense for you to do.

thanks for the reply .

Link to comment
Share on other sites

  • 4 weeks later...

another question to add .

 

i have  a field in service that has a value as array , what is the correct way/format to print the value of this field in the welcome email ?

array(
    'key' => "options",
    'value' => array(
                     'options1' => "options1",
                     'options2' => "options2",
                     'options3' => "options3"
                     ),
    'encrypted' => 0
   )

is this should work {service.options.options1} or {service.options['options1']} ?

Link to comment
Share on other sites

another question to add .

 

i have  a field in service that has a value as array , what is the correct way/format to print the value of this field in the welcome email ?

array(
    'key' => "options",
    'value' => array(
                     'options1' => "options1",
                     'options2' => "options2",
                     'options3' => "options3"
                     ),
    'encrypted' => 0
   )

is this should work {service.options.options1} or {service.options['options1']} ?

 

The first way is the correct format: {service.options.options1}

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
Reply to this topic...

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