Custom Mail Provider

The Custom Mail Provider allows you to customize your application’s email sending process using an infrastructure of your choice or a third-party service. With this feature, you can use your own SMTP server, an email sending API (such as SendGrid, Mailgun, or Amazon SES), or an on-premises email infrastructure instead of Kuika’s default email sending mechanism.

The Custom Mail Provider can be used in the following scenarios:

  • When the application needs to use the organization’s own SMTP server instead of Kuika’s default mail provider,
  • When email deliveries are to be handled through a third-party service (such as SendGrid, Mailgun, or Amazon SES),
  • When the content, subject line, or sending logic (e.g., logging, additional validation, custom template processing) of sent emails needs to be customized,
  • When different email providers need to be used for different environments (development, staging, production) or different tenants.

Creation Steps

  1. From the Data Sources module, select the C# data source and enter a name.
  2. Select the Custom Mail Provider method.
  3. Click the CREATE button.

Custom Mail Provider Class

The Custom Mail Provider class implements the relevant email interface and defines email sending functions. The following method is provided ready for use:

Send Method: Handles email sending requests triggered from within the application. This method accepts the recipient address, subject, body content, and any attachments as parameters and ensures they are transmitted via the email infrastructure you have defined.

The method’s tasks:

  • Retrieve the provided recipient (To), subject (Subject), and body (Body) information,
  • Transmit this information in the format appropriate for the selected email infrastructure (SMTP, SendGrid, Mailgun, etc.),
  • Return the relevant result to Kuika upon successful or failed delivery.
Fields that do not return a null value are valid within the Custom Mail Provider. Fields that return null are considered invalid within Kuika; in this case, Kuika’s default email behavior takes effect.
Sensitive information such as the API key, username, and password for the email provider must be stored securely within the code and must not be logged.