Creating E-Mails using BS Skills API

Within the BS Skills, there is a new API method available to create E-Mails. Even though sending E-Mails through SMTP is available in the CORE as well, it is often not configured or only difficult to configure, as IT and system admin support is required along with cooperation and communication between multiple parties. Also, the standard mail sending API requires an XML template for the mail content and therefore cooperation of 

  • a web developer to design the HTML mail text
  • a Contentserv developer to understand how to integrate the template in Contentserv
  • a web server or system admin to deploy the template to the file system of the webserver

All in all sending E-Mails is for that reason simply not used. As the whole idea of the BS Skills is the empowerment of simple business users for "gettings things done", the BS Skills added a simple to use and reliable E-Mail concept. 

Configuration

The E-Mail API is using a library called PHP Mailer. This API is able to connect to an SMTP host and does not require any php.ini or local SMTP configuration.

The configuration requires the following settings:

It is even possible to leave out the SMTP settings here and use default settings sending mails through the Contentserv account no-reply@contentserv.com. However, be aware of the following issues, when using the BS account:

  • emails are visible to the Contentserv Mail Administrator,
  • all emails are transferred through the open internet in a non-encrypted format and visible to network sniffers,
  • it is not possible to change the "From E-Mail" setting so that all mails are sent through the "Contentserv PIM" user account "no-reply@contentserv.com".

For that reason, it might be ok to quickly start and use the empty default settings for test, demo, dev or QA environments. But in production at least, it is strongly recommended to configure here an official SMTP server.

Providing custom Mail Templates

The E-Mail Template setting allows using custom project templates as Zend View .phtml-files.

To be available here provide your templates to the folder

Project/templates/bs/mail/scripts/

and make them end with .phtml. Have a look at the default template to match the syntax, which can be found at

Project/modules/alani/gui/scripts/Default.phtml

Using the API

The API is implemented as a static function of the CSAlani.php API with the following signature:


A simple call would look like this:

Sending Attachments

Interesting always is sending attachments along with E-Mails because of the following questions:

  • how large can embedded attachments become?
  • if not embedded, can the recipient access the linked attachment on the Contentserv webserver?

The answer to the first question depends on the recipient's E-Mail provider.

A first idea gives the following table:

Email ProviderMaximum Email Size Limit
Gmail25Mb (per email sent or received)
Outlook.com and Hotmail10Mb (per file attachment) or 300Gb (only for files attached via SkyDrive!)
Yahoo Mail25Mb (per email) or unlimited (only for files attached via DropBox – limited by your DropBox account size)
AOL25Mb (per email sent or received)
Mail.com50Mb (per attachment) and 10Mb (per file)
Zoho Mail12Mb (per email) and 10Mb (per file)
GoDaddy Workspace30Mb (per email) and 20Mb (per file)
Email ClientMaximum Email Size Limit
Microsoft Outlook20Mb (per attachment)
Mozilla Thunderbirdunlimited
Windows Live Mail10Gb (per email) and no more than 50Mb per file attached

So in general 25MB should be a good limit unless your organization uses Zoho.

If the total size of attachments exceeds the 25MB limit it is recommended to list all attachments within the HTML body as hyperlinks. Contentserv provides here the method


The $base parameter should be set to 'external' of course then.

When creating links to files on the CS web server always keep in mind, that the web server could be hidden behind the companies firewall and not be accessible for recipients. There is another BS Skills method to automatically upload such files first to a public web server and then create the link pointing to this external public web server:

For further information on such public links and how to configure click on this link.