|
| 1 | +--- |
| 2 | +title: Resend membership invitation notification |
| 3 | +--- |
| 4 | + |
| 5 | +# Resend membership invitation notification |
| 6 | + |
| 7 | +If an invited account member doesn't receive their invitation email, you can resend it using the [`sendAccountMembershipInviteNotification` mutation](https://api-reference.swan.io/mutations/send-account-membership-invite-notification/). |
| 8 | + |
| 9 | +This guide explains how to send partner-branded email notifications when inviting account members. |
| 10 | + |
| 11 | +## Guide {#guide} |
| 12 | + |
| 13 | +### Prerequisites {#prerequisites} |
| 14 | + |
| 15 | +- You must authenticate with a **user access token** associated with an existing account member who has the `canManageAccountMembership` permission. |
| 16 | +- Only account members with the `canManageAccountMembership` permission can send invitation notifications. |
| 17 | +- The account membership status must be `InvitationSent`. |
| 18 | +- You can resend invitations up to **five times per day** per membership. |
| 19 | + |
| 20 | +### Step 1: Call the mutation {#call-mutation} |
| 21 | + |
| 22 | +Call the `sendAccountMembershipInviteNotification` mutation with the `accountMembershipId` of the membership for which you want to send the invitation. |
| 23 | + |
| 24 | +<a href="https://explorer.swan.io?query=bXV0YXRpb24gUmVzZW5kSW52aXRhdGlvbiB7CiAgc2VuZEFjY291bnRNZW1iZXJzaGlwSW52aXRlTm90aWZpY2F0aW9uKAogICAgaW5wdXQ6IHsgYWNjb3VudE1lbWJlcnNoaXBJZDogIiRZT1VSX0FDQ09VTlRfTUVNQkVSU0hJUF9JRCIgfQogICkgewogICAgLi4uIG9uIFNlbmRBY2NvdW50TWVtYmVyc2hpcEludml0ZU5vdGlmaWNhdGlvblN1Y2Nlc3NQYXlsb2FkIHsKICAgICAgX190eXBlbmFtZQogICAgICBub3RpZmljYXRpb25SZXF1ZXN0SWQKICAgIH0KICAgIC4uLiBvbiBBY2NvdW50TWVtYmVyc2hpcE5vdEZvdW5kUmVqZWN0aW9uIHsKICAgICAgaWQKICAgICAgbWVzc2FnZQogICAgfQogICAgLi4uIG9uIEFjY291bnRNZW1iZXJzaGlwU3RhdHVzTm90RWxpZ2libGVSZWplY3Rpb24gewogICAgICBtZXNzYWdlCiAgICB9CiAgICAuLi4gb24gTWF4aW11bURhaWx5SW52aXRhdGlvbnNSZWFjaGVkUmVqZWN0aW9uIHsKICAgICAgbWVzc2FnZQogICAgfQogICAgLi4uIG9uIFVzZXJOb3RBbGxvd2VkVG9NYW5hZ2VBY2NvdW50TWVtYmVyc2hpcFJlamVjdGlvbiB7CiAgICAgIG1lc3NhZ2UKICAgIH0KICAgIC4uLiBvbiBVc2VyTm90QWxsb3dlZFRvU2VuZEFjY291bnRNZW1iZXJzaGlwSW52aXRhdGlvblJlamVjdGlvbiB7CiAgICAgIG1lc3NhZ2UKICAgIH0KICAgIC4uLiBvbiBGb3JiaWRkZW5SZWplY3Rpb24gewogICAgICBtZXNzYWdlCiAgICB9CiAgICAuLi4gb24gVmFsaWRhdGlvblJlamVjdGlvbiB7CiAgICAgIGZpZWxkcyB7CiAgICAgICAgY29kZQogICAgICAgIG1lc3NhZ2UKICAgICAgICBwYXRoCiAgICAgIH0KICAgICAgbWVzc2FnZQogICAgfQogIH0KfQo%3D" className="explorer-badge">Open in API Explorer</a> |
| 25 | + |
| 26 | +```graphql {3} showLineNumbers |
| 27 | +mutation ResendInvitation { |
| 28 | + sendAccountMembershipInviteNotification( |
| 29 | + input: { accountMembershipId: "$YOUR_ACCOUNT_MEMBERSHIP_ID" } |
| 30 | + ) { |
| 31 | + ... on SendAccountMembershipInviteNotificationSuccessPayload { |
| 32 | + __typename |
| 33 | + notificationRequestId |
| 34 | + } |
| 35 | + ... on AccountMembershipNotFoundRejection { |
| 36 | + id |
| 37 | + message |
| 38 | + } |
| 39 | + ... on AccountMembershipStatusNotEligibleRejection { |
| 40 | + message |
| 41 | + } |
| 42 | + ... on MaximumDailyInvitationsReachedRejection { |
| 43 | + message |
| 44 | + } |
| 45 | + ... on UserNotAllowedToManageAccountMembershipRejection { |
| 46 | + message |
| 47 | + } |
| 48 | + ... on UserNotAllowedToSendAccountMembershipInvitationRejection { |
| 49 | + message |
| 50 | + } |
| 51 | + ... on ForbiddenRejection { |
| 52 | + message |
| 53 | + } |
| 54 | + ... on ValidationRejection { |
| 55 | + fields { |
| 56 | + code |
| 57 | + message |
| 58 | + path |
| 59 | + } |
| 60 | + message |
| 61 | + } |
| 62 | + } |
| 63 | +} |
| 64 | +``` |
| 65 | + |
| 66 | +### Step 2: Receive the confirmation {#confirmation} |
| 67 | + |
| 68 | +The API returns a `notificationRequestId` that you can use to track the email delivery if needed. |
| 69 | + |
| 70 | +If a user reports problems with email delivery, provide this ID to [Swan Support](https://support.swan.io/hc/en-150) to help investigate the issue. |
| 71 | + |
| 72 | +```json {4} showLineNumbers |
| 73 | +{ |
| 74 | + "data": { |
| 75 | + "sendAccountMembershipInviteNotification": { |
| 76 | + "__typename": "SendAccountMembershipInviteNotificationSuccessPayload", |
| 77 | + "notificationRequestId": "3f5a787a-5709-43a2-90dd-7508b71cdf7b" |
| 78 | + } |
| 79 | + } |
| 80 | +} |
| 81 | +``` |
| 82 | + |
| 83 | +:::info Delivery status |
| 84 | +The API currently does not display the delivery status of notifications. Please contact [Swan Support](https://support.swan.io/hc/en-150) if you encounter any issues with email delivery. |
| 85 | +::: |
| 86 | + |
| 87 | +## Rejection reasons {#rejections} |
| 88 | + |
| 89 | +The mutation can return several rejection reasons if the request can't be completed: |
| 90 | + |
| 91 | +| Rejection | Reason | |
| 92 | +|---|---| |
| 93 | +| `AccountMembershipNotFoundRejection` | The account membership ID doesn't exist. | |
| 94 | +| `AccountMembershipStatusNotEligibleRejection` | The account membership status must be `InvitationSent` to send an invitation notification. | |
| 95 | +| `MaximumDailyInvitationsReachedRejection` | You've reached the maximum of five invitation emails per day for this membership. | |
| 96 | +| `UserNotAllowedToManageAccountMembershipRejection` | The authenticated user doesn't have the `canManageAccountMembership` permission. | |
| 97 | +| `UserNotAllowedToSendAccountMembershipInvitationRejection` | The user's account membership status must be `Enabled` to send invitations. | |
| 98 | +| `ForbiddenRejection` | The operation is forbidden in the current context. | |
| 99 | +| `ValidationRejection` | The request contains validation errors. | |
| 100 | + |
| 101 | +## Notification details {#details} |
| 102 | + |
| 103 | +The invitation notification email: |
| 104 | + |
| 105 | +- Is sent to the email address specified when creating the account membership. |
| 106 | +- Uses the account member's preferred language if set, otherwise the account's default language. |
| 107 | +- Includes your partner branding (logo and accent colors). |
| 108 | +- Contains a link for the invited member to accept the invitation and bind their Swan user account to the membership. |
| 109 | +- Can be translated into multiple languages automatically. |
| 110 | + |
| 111 | +If you have feedback about notification translations, contact [Swan Support](https://support.swan.io/hc/en-150) and specify the notification and language. |
0 commit comments