createInboxWithHttpInfo method

Future<Response> createInboxWithHttpInfo({
  1. String? emailAddress,
  2. List<String>? tags,
  3. String? name,
  4. String? description,
  5. bool? useDomainPool,
  6. bool? favourite,
  7. DateTime? expiresAt,
  8. int? expiresIn,
  9. bool? allowTeamAccess,
  10. String? inboxType,
  11. bool? virtualInbox,
  12. bool? useShortAddress,
  13. String? domainId,
  14. String? domainName,
})

Create an inbox email address. An inbox has a real email address and can send and receive emails. Inboxes can be either SMTP or HTTP inboxes.

Create a new inbox and with a randomized email address to send and receive from. Pass emailAddress parameter if you wish to use a specific email address. Creating an inbox is required before sending or receiving emails. If writing tests it is recommended that you create a new inbox during each test method so that it is unique and empty.

Note: This method returns the HTTP Response.

Parameters:

  • String emailAddress: A custom email address to use with the inbox. Defaults to null. When null MailSlurp will assign a random email address to the inbox such as 123@mailslurp.com. If you use the useDomainPool option when the email address is null it will generate an email address with a more varied domain ending such as 123@mailslurp.info or 123@mailslurp.biz. When a custom email address is provided the address is split into a domain and the domain is queried against your user. If you have created the domain in the MailSlurp dashboard and verified it you can use any email address that ends with the domain. Note domain types must match the inbox type - so SMTP inboxes will only work with SMTP type domains. Avoid SMTP inboxes if you need to send emails as they can only receive. Send an email to this address and the inbox will receive and store it for you. To retrieve the email use the Inbox and Email Controller endpoints with the inbox ID.

  • List<String> tags: Tags that inbox has been tagged with. Tags can be added to inboxes to group different inboxes within an account. You can also search for inboxes by tag in the dashboard UI.

  • String name: Optional name of the inbox. Displayed in the dashboard for easier search and used as the sender name when sending emails.

  • String description: Optional description of the inbox for labelling purposes. Is shown in the dashboard and can be used with

  • bool useDomainPool: Use the MailSlurp domain name pool with this inbox when creating the email address. Defaults to null. If enabled the inbox will be an email address with a domain randomly chosen from a list of the MailSlurp domains. This is useful when the default @mailslurp.com email addresses used with inboxes are blocked or considered spam by a provider or receiving service. When domain pool is enabled an email address will be generated ending in @mailslurp.{world,info,xyz,...} . This means a TLD is randomly selecting from a list of .biz, .info, .xyz etc to add variance to the generated email addresses. When null or false MailSlurp uses the default behavior of @mailslurp.com or custom email address provided by the emailAddress field. Note this feature is only available for HTTP inbox types.

  • bool favourite: Is the inbox a favorite. Marking an inbox as a favorite is typically done in the dashboard for quick access or filtering

  • DateTime expiresAt: Optional inbox expiration date. If null then this inbox is permanent and the emails in it won't be deleted. If an expiration date is provided or is required by your plan the inbox will be closed when the expiration time is reached. Expired inboxes still contain their emails but can no longer send or receive emails. An ExpiredInboxRecord is created when an inbox and the email address and inbox ID are recorded. The expiresAt property is a timestamp string in ISO DateTime Format yyyy-MM-dd'T'HH:mm:ss.SSSXXX.

  • int expiresIn: Number of milliseconds that inbox should exist for

  • bool allowTeamAccess: DEPRECATED (team access is always true). Grant team access to this inbox and the emails that belong to it for team members of your organization.

  • String inboxType: HTTP (default) or SMTP inbox type. HTTP inboxes are default and best solution for most cases. SMTP inboxes are more reliable for public inbound email consumption (but do not support sending emails). When using custom domains the domain type must match the inbox type. HTTP inboxes are processed by AWS SES while SMTP inboxes use a custom mail server running at mx.mailslurp.com.

  • bool virtualInbox: Virtual inbox prevents any outbound emails from being sent. It creates sent email records but will never send real emails to recipients. Great for testing and faking email sending.

  • bool useShortAddress: Use a shorter email address under 31 characters

  • String domainId: ID of custom domain to use for email address.

  • String domainName: FQDN domain name for the domain you have verified. Will be appended with a randomly assigned recipient name. Use the emailAddress option instead to specify the full custom inbox.

Implementation

Future<Response> createInboxWithHttpInfo({ String? emailAddress, List<String>? tags, String? name, String? description, bool? useDomainPool, bool? favourite, DateTime? expiresAt, int? expiresIn, bool? allowTeamAccess, String? inboxType, bool? virtualInbox, bool? useShortAddress, String? domainId, String? domainName, }) async {
  // ignore: prefer_const_declarations
  final path = r'/inboxes';

  // ignore: prefer_final_locals
  Object? postBody;

  final queryParams = <QueryParam>[];
  final headerParams = <String, String>{};
  final formParams = <String, String>{};

  if (emailAddress != null) {
    queryParams.addAll(_queryParams('', 'emailAddress', emailAddress));
  }
  if (tags != null) {
    queryParams.addAll(_queryParams('multi', 'tags', tags));
  }
  if (name != null) {
    queryParams.addAll(_queryParams('', 'name', name));
  }
  if (description != null) {
    queryParams.addAll(_queryParams('', 'description', description));
  }
  if (useDomainPool != null) {
    queryParams.addAll(_queryParams('', 'useDomainPool', useDomainPool));
  }
  if (favourite != null) {
    queryParams.addAll(_queryParams('', 'favourite', favourite));
  }
  if (expiresAt != null) {
    queryParams.addAll(_queryParams('', 'expiresAt', expiresAt));
  }
  if (expiresIn != null) {
    queryParams.addAll(_queryParams('', 'expiresIn', expiresIn));
  }
  if (allowTeamAccess != null) {
    queryParams.addAll(_queryParams('', 'allowTeamAccess', allowTeamAccess));
  }
  if (inboxType != null) {
    queryParams.addAll(_queryParams('', 'inboxType', inboxType));
  }
  if (virtualInbox != null) {
    queryParams.addAll(_queryParams('', 'virtualInbox', virtualInbox));
  }
  if (useShortAddress != null) {
    queryParams.addAll(_queryParams('', 'useShortAddress', useShortAddress));
  }
  if (domainId != null) {
    queryParams.addAll(_queryParams('', 'domainId', domainId));
  }
  if (domainName != null) {
    queryParams.addAll(_queryParams('', 'domainName', domainName));
  }

  const contentTypes = <String>[];


  return apiClient.invokeAPI(
    path,
    'POST',
    queryParams,
    postBody,
    headerParams,
    formParams,
    contentTypes.isEmpty ? null : contentTypes.first,
  );
}