Email Template Hooks

Namespace: DirectScale.Disco.Extension.Hooks.EmailHooks

GetTemplateWelcomeCustomer

Override and set the Welcome Customer Email Template. By default, you can enable it in Corporate Admin > Settings > Advanced Settings > UI. To modify the template, go to Corporate Admin > Settings > Company Settings > Email Settings.

Basic Implementation

public class GetTemplateWelcomeCustomer : IHook<WelcomeCustomerTemplateRequest, EmailTemplateResponse>
{
  public GetTemplateWelcomeCustomer() { }

  public EmailTemplateResponse Invoke(WelcomeCustomerTemplateRequest request, Func<WelcomeCustomerTemplateRequest, EmailTemplateResponse> func)
  {
    return func(request);
  }
}

Register Hook

services.AddTransient<IHook<WelcomeCustomerTemplateRequest, EmailTemplateResponse>, GetTemplateWelcomeCustomer>();

Request Model

{
  "AssociateId": 0,
  "Localization": {
    "CountryCode": "string",
    "LanguageCode": "string",
    "CurrencyCode": "string",
    "RegionId": 0
  }
}

Response Model

{
  "EmailMessage": {
    "Subject": "string",
    "Body": "string"
  }
}

GetTemplateWelcomeDistributor

Override and set the Welcome Distributor Email Template. By default, you can enable it in Corporate Admin > Settings > Advanced Settings > UI. To modify the template, go to Corporate Admin > Settings > Company Settings > Email Settings.

Basic Implementation

public class GetTemplateWelcomeDistributor : IHook<WelcomeDistributoremplateRequest, EmailTemplateResponse>
{
  public GetTemplateWelcomeDistributor() { }

  public EmailTemplateResponse Invoke(WelcomeDistributoremplateRequest request, Func<WelcomeDistributoremplateRequest, EmailTemplateResponse> func)
  {
    return func(request);
  }
}

Register Hook

services.AddTransient<IHook<WelcomeDistributoremplateRequest, EmailTemplateResponse>, GetTemplateWelcomeDistributor>();

Request Model

{
  "AssociateId": 0,
  "Localization": {
    "CountryCode": "string",
    "LanguageCode": "string",
    "CurrencyCode": "string",
    "RegionId": 0
  }
}

Response Model

{
  "EmailMessage": {
    "Subject": "string",
    "Body": "string"
  }
}

GetTemplateAutoshipFailed

Override and set Autoship Error Email Template. By default, you can enable it in Corporate Admin > Settings > Advanced Settings > UI. To modify the template, go to Corporate Admin > Settings > Company Settings > Email Settings.

Basic Implementation

public class GetTemplateAutoshipError : IHook<AutoshipFailedRequest, EmailTemplateResponse>
{
  public GetTemplateAutoshipError() { }

  public EmailTemplateResponse Invoke(AutoshipFailedRequest request, Func<AutoshipFailedRequest, EmailTemplateResponse> func)
  {
    return func(request);
  }
}

Register Hook

services.AddTransient<IHook<AutoshipFailedRequest, EmailTemplateResponse>, GetTemplateAutoshipError>();

Request Model

{
  "AssociateId": 0,
  "Localization": {
    "CountryCode": "string",
    "LanguageCode": "string",
    "CurrencyCode": "string",
    "RegionId": 0
  },
  "AutoshipId": 0,
  "OnFailRule": {
    "Charge": false,
    "AssociateStatusId": 0,
    "SendEmail": null,
    "Cancel": null,
    "NotificationCount": null
  },
  "Message": "string"
}

Response Model

{
  "EmailMessage": {
    "Subject": "string",
    "Body": "string"
  }
}

GetTemplateOrderReceipt

Override and set the Order Receipt Email Template. By default, you can enable it in Corporate Admin > Settings > Advanced Settings > UI. To modify the template, go to Corporate Admin > Settings > Company Settings > Email Settings.

Basic Implementation

public class GetTemplateOrderReceipt : IHook<OrderRecieptRequest, EmailTemplateResponse>
{
  public GetTemplateOrderReceipt() { }

  public EmailTemplateResponse Invoke(OrderRecieptRequest request, Func<OrderRecieptRequest, EmailTemplateResponse> func)
  {
    return func(request);
  }
}

Register Hook

services.AddTransient<IHook<OrderRecieptRequest, EmailTemplateResponse>, GetTemplateOrderReceipt>();

Request Model

{
  "AssociateId": 0,
  "Localization": {
    "CountryCode": "string",
    "LanguageCode": "string",
    "CurrencyCode": "string",
    "RegionId": 0
  },
  "OrderNumber": 0
}

Response Model

{
  "EmailMessage": {
    "Subject": "string",
    "Body": "string"
  }
}

GetTemplateOrderFailed

Set Order Failed Notification Email Template.

Basic Implementation

public class GetTemplateOrderFailed: IHook<OrderFailedRequest, EmailTemplateResponse>
{
  public GetTemplateOrderFailed () { }

  public EmailTemplateResponse Invoke(OrderFailedRequest request, Func<OrderFailedRequest, EmailTemplateResponse> func)
  {
    return func(request);
  }
}

Register Hook

services.AddTransient<IHook<OrderFailedRequest, EmailTemplateResponse>, GetTemplateOrderFailed>();

Request Model

{
  "AssociateId": 0,
  "Localization": {
    "CountryCode": "string",
    "LanguageCode": "string",
    "CurrencyCode": "string",
    "RegionId": 0
  },
  "OrderNumber": 0,
  "Message": "string"
}

Response Model

{
  "EmailMessage": {
    "Subject": "string",
    "Body": "string"
  }
}

GetTemplateSubscriptionAboutToExpire

Set Subscription About to Expire Email Template.

Basic Implementation

public class GetTemplateSubscriptionAboutToExpire : IHook<SubscriptionAboutToExpireRequest, EmailTemplateResponse>
{
  public GetTemplateSubscriptionAboutToExpire() { }

  public EmailTemplateResponse Invoke(SubscriptionAboutToExpireRequest request, Func<SubscriptionAboutToExpireRequest, EmailTemplateResponse> func)
  {
    return func(request);
  }
}

Register Hook

services.AddTransient<IHook<SubscriptionAboutToExpireRequest, EmailTemplateResponse>, GetTemplateSubscriptionAboutToExpire>();

Request Model

{
  "AssociateId": 0,
  "Localization": {
    "CountryCode": "string",
    "LanguageCode": "string",
    "CurrencyCode": "string",
    "RegionId": 0
  },
  "SubscriptionId": null,
  "RetryCount": null
}

Response Model

{
  "EmailMessage": {
    "Subject": "string",
    "Body": "string"
  }
}

GetTemplateSubscriptionExpire

Set Subscription Expire Email Template.

Basic Implementation

public class GetTemplateSubscriptionExpire : IHook<SubscriptionExpireRequest, EmailTemplateResponse>
{
  public GetTemplateSubscriptionExpire() { }

  public EmailTemplateResponse Invoke(SubscriptionExpireRequest request, Func<SubscriptionExpireRequest, EmailTemplateResponse> func)
  {
    return func(request);
  }
}

Register Hook

services.AddTransient<IHook<SubscriptionExpireRequest, EmailTemplateResponse>, GetTemplateSubscriptionExpire>();

Request Model

{
  "AssociateId": 0,
  "Localization": {
    "CountryCode": "string",
    "LanguageCode": "string",
    "CurrencyCode": "string",
    "RegionId": 0
  },
  "SubscriptionId": null,
  "RetryCount": null
}

Response Model

{
  "EmailMessage": {
    "Subject": "string",
    "Body": "string"
  }
}
Was this article helpful?
0 out of 0 found this helpful
Previous Next

Comments

0 comments

Please sign in to leave a comment.