Email Templates

using DirectScale.Disco.Extension.Hooks.EmailHooks;

GetTemplateWelcomeCustomer

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

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

  public EmailTemplateResponse Invoke(WelcomeCustomerTemplateRequest request, Func<WelcomeCustomerTemplateRequest, EmailTemplateResponse> func)
  {
    return func(request);
  }
}
services.AddTransient<IHook<WelcomeCustomerTemplateRequest, EmailTemplateResponse>, GetTemplateWelcomeCustomer>();
{
  "AssociateId": 0,
  "Localization": {
    "CountryCode": "string",
    "LanguageCode": "string",
    "CurrencyCode": "string",
    "RegionId": 0
  }
}
{
  "EmailMessage": {
    "Subject": "string",
    "Body": "string"
  }
}


GetTemplateWelcomeDistributor

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

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

  public EmailTemplateResponse Invoke(WelcomeDistributoremplateRequest request, Func<WelcomeDistributoremplateRequest, EmailTemplateResponse> func)
  {
    return func(request);
  }
}
services.AddTransient<IHook<WelcomeDistributoremplateRequest, EmailTemplateResponse>, GetTemplateWelcomeDistributor>();
{
  "AssociateId": 0,
  "Localization": {
    "CountryCode": "string",
    "LanguageCode": "string",
    "CurrencyCode": "string",
    "RegionId": 0
  }
}
{
  "EmailMessage": {
    "Subject": "string",
    "Body": "string"
  }
}


GetTemplateAutoshipFailed

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

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

  public EmailTemplateResponse Invoke(AutoshipFailedRequest request, Func<AutoshipFailedRequest, EmailTemplateResponse> func)
  {
    return func(request);
  }
}
services.AddTransient<IHook<AutoshipFailedRequest, EmailTemplateResponse>, GetTemplateAutoshipError>();
{
  "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"
}
{
  "EmailMessage": {
    "Subject": "string",
    "Body": "string"
  }
}


GetTemplateOrderReceipt

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

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

  public EmailTemplateResponse Invoke(OrderRecieptRequest request, Func<OrderRecieptRequest, EmailTemplateResponse> func)
  {
    return func(request);
  }
}
services.AddTransient<IHook<OrderRecieptRequest, EmailTemplateResponse>, GetTemplateOrderReceipt>();
{
  "AssociateId": 0,
  "Localization": {
    "CountryCode": "string",
    "LanguageCode": "string",
    "CurrencyCode": "string",
    "RegionId": 0
  },
  "OrderNumber": 0
}
{
  "EmailMessage": {
    "Subject": "string",
    "Body": "string"
  }
}


GetTemplateOrderFailed

Set Order Failed Notification email Template.

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

  public EmailTemplateResponse Invoke(OrderFailedRequest request, Func<OrderFailedRequest, EmailTemplateResponse> func)
  {
    return func(request);
  }
}
services.AddTransient<IHook<OrderFailedRequest, EmailTemplateResponse>, GetTemplateOrderFailed>();
{
  "AssociateId": 0,
  "Localization": {
    "CountryCode": "string",
    "LanguageCode": "string",
    "CurrencyCode": "string",
    "RegionId": 0
  },
  "OrderNumber": 0,
  "Message": "string"
}
{
  "EmailMessage": {
    "Subject": "string",
    "Body": "string"
  }
}


GetTemplateSubscriptionAboutToExpire

Set Subscription About to Expire email Template.

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

  public EmailTemplateResponse Invoke(SubscriptionAboutToExpireRequest request, Func<SubscriptionAboutToExpireRequest, EmailTemplateResponse> func)
  {
    return func(request);
  }
}
services.AddTransient<IHook<SubscriptionAboutToExpireRequest, EmailTemplateResponse>, GetTemplateSubscriptionAboutToExpire>();
{
  "AssociateId": 0,
  "Localization": {
    "CountryCode": "string",
    "LanguageCode": "string",
    "CurrencyCode": "string",
    "RegionId": 0
  },
  "SubscriptionId": null,
  "RetryCount": null
}
{
  "EmailMessage": {
    "Subject": "string",
    "Body": "string"
  }
}


GetTemplateSubscriptionExpire

Set Subscription Expire email Template.

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

  public EmailTemplateResponse Invoke(SubscriptionExpireRequest request, Func<SubscriptionExpireRequest, EmailTemplateResponse> func)
  {
    return func(request);
  }
}
services.AddTransient<IHook<SubscriptionExpireRequest, EmailTemplateResponse>, GetTemplateSubscriptionExpire>();
{
  "AssociateId": 0,
  "Localization": {
    "CountryCode": "string",
    "LanguageCode": "string",
    "CurrencyCode": "string",
    "RegionId": 0
  },
  "SubscriptionId": null,
  "RetryCount": null
}
{
  "EmailMessage": {
    "Subject": "string",
    "Body": "string"
  }
}

Did this page help you?