-
-
Notifications
You must be signed in to change notification settings - Fork 1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(email-plugin): Create handler for email address change
Relates to #87
- Loading branch information
1 parent
8f0c6e7
commit 8a5907e
Showing
6 changed files
with
57 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,13 @@ | ||
import { LanguageCode } from '@vendure/common/lib/generated-types'; | ||
import { | ||
AccountRegistrationEvent, | ||
Channel, | ||
Customer, | ||
IdentifierChangeRequestEvent, | ||
Order, | ||
OrderItem, | ||
OrderLine, | ||
OrderStateTransitionEvent, PasswordResetEvent, | ||
OrderStateTransitionEvent, | ||
PasswordResetEvent, | ||
ProductVariant, | ||
RequestContext, | ||
User, | ||
} from '@vendure/core'; | ||
|
||
|
@@ -111,3 +110,12 @@ export const mockPasswordResetEvent = new PasswordResetEvent( | |
passwordResetToken: 'MjAxOS0wNC0xNVQxMzozMDozOC43MjFa_MA2FR6HRZBW7JWD6', | ||
}), | ||
); | ||
|
||
export const mockEmailAddressChangeEvent = new IdentifierChangeRequestEvent( | ||
{} as any, | ||
new User({ | ||
identifier: '[email protected]', | ||
pendingIdentifier: '[email protected]', | ||
identifierChangeToken: 'MjAxOS0wNC0xNVQxMzozMDozOC43MjFa_MA2FR6HRZBW7JWD6', | ||
}), | ||
); |
20 changes: 20 additions & 0 deletions
20
packages/email-plugin/templates/email-address-change/body.hbs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
{{> header title="Verify Your New Email Address" }} | ||
|
||
<mj-section background-color="#fafafa"> | ||
<mj-column> | ||
<mj-text color="#525252"> | ||
We received a request to change your registered email address to this one. | ||
Click the button below to verify this address and complete the process: | ||
</mj-text> | ||
|
||
<mj-button font-family="Helvetica" | ||
background-color="#f45e43" | ||
color="white" | ||
href="{{ changeEmailAddressUrl }}?token={{ user.identifierChangeToken }}"> | ||
Verify Me! | ||
</mj-button> | ||
</mj-column> | ||
</mj-section> | ||
|
||
|
||
{{> footer }} |