Add a new delivery server type

Add a new delivery server type

If you look in apps/common/models/ you will see lots of files called DeliveryServer{TYPE}.php where type is the provider they implement, for example DeliveryServerAmazonSesWebApi.php
In order to create your own delivery server implementation, you have to follow below steps:

1) You have to create your own DeliveryServerMySuperProvider.php in apps/common/models (or any other location given it is registered for autoloading) and inside the file implement your sending logic.
Given the high number of providers AppMail supports, you have plenty examples on how to go about it.

2) After you’re done with that file, you have to register your new server type in DeliveryServer::getTypesMapping(/apps/common/models/DeliveryServer.php around line 797)
So, you can do it from the file directly, or if you add this delivery server type via an extension, there is this filter hook you can use: delivery_servers_get_types_mapping so:

Yii::app()->hooks->addFilter('delivery_servers_get_types_mapping', function($mapping){
    $mapping['my-super-provider'] = 'DeliveryServerMySuperProvider';
    return $mapping;
});

You need to register it here so that it appears in that dropdown of options when creating a new delivery server type for example.

3) in apps/{backend,customer}/views/delivery_servers/ you have to create the actual form where people will insert the server connection info and so on.
So, you will create a file named form-my-super-provider.php and in it put your form fields, again, you can copy from other form files and then adjust as needed.

    • Related Articles

    • Adding a new Amazon SES delivery server (Web API)

      This article will drive you through the steps on creating and validating an Amazon SES delivery server. First of all, you have to create an account here. Once you are done and you are logged in, you should search for the Simple Email Service. The ...
    • How to add delivery servers for an individual customer?

      You need to go to Backend > Settings > Customers and select the Servers tab. From this screen, select the number of delivery servers the customer is allowed to add, but also what type of delivery servers he is allowed to add. Once you do this, save ...
    • Delivery Servers Warmup Plans

      Starting with the version 2.1.10 we added the delivery servers Warmup Plans feature, which was long requested by our customers. Some background on the "Warming Process" Delivery server warming is the gradual process of establishing a reputation as a ...
    • Cannot find a valid server to send the campaign email, aborting until a delivery server is available!

      This error is shown because AppMail does not have a delivery server to pick to send the current campaign. This can happen for various reasons, such as: 1) You actually have never created a delivery server in the first place. 2) You did create a ...
    • Delivery servers

      Delivery servers are needed in order to send out all the emails from the application. Even if it’s about sending a confirmation email, an email campaign, a test email, you need a delivery server to actually make the delivery. AppMail comes with ...