1. Home
  2. Developers
  3. 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 you 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 mailwizz 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.

That’s it.

Was this article helpful?

Related Articles