diff --git a/orcid-core/src/main/resources/i18n/email_subject_en.properties b/orcid-core/src/main/resources/i18n/email_subject_en.properties
index b517db4da7f..c47b6f21991 100644
--- a/orcid-core/src/main/resources/i18n/email_subject_en.properties
+++ b/orcid-core/src/main/resources/i18n/email_subject_en.properties
@@ -17,5 +17,5 @@ email.subject.admin_as_delegate=[ORCID] Trusting {0} with your ORCID Record
email.subject.locked=[ORCID] Your account has been locked
email.subject.auto_deprecate=[ORCID] An account has been deprecated
email.subject.reactivation=[ORCID] Reactivating your ORCID record
-email.subject.register.welcome=[ORCID] Welcome to ORCID - verify your email address
+email.subject.register.welcome=[ORCID] Welcome to ORCID
email.subject.delegate.recipient=[ORCID] You've made an Account Delegate!
diff --git a/orcid-core/src/main/resources/i18n/email_welcome_en.properties b/orcid-core/src/main/resources/i18n/email_welcome_en.properties
index cd9ffc14be1..58b30c52d9f 100644
--- a/orcid-core/src/main/resources/i18n/email_welcome_en.properties
+++ b/orcid-core/src/main/resources/i18n/email_welcome_en.properties
@@ -32,30 +32,16 @@
#Need Help?
#
#If you have any questions or need help, contact the ORCID support team or visit https://support.orcid.org.
-email.welcome.thank_you.1=Thank you for creating your ORCID identifier. Please verify your email address to complete your registration and gain access to manually edit your record: click the following link and sign into your ORCID record. If you can't click the link, copy and paste it into your browser's address bar.
email.button=Verify your email address
-email.welcome.your_id.id=Your 16-digit ORCID identifier is
-email.welcome.your_id.link=, and your full ORCID iD and the link to your public record is
-email.welcome.next_steps=Next steps:
-email.welcome.next_steps.1=1. Add more information to your ORCID Record
-email.welcome.next_steps.1.description.1.1=Access your ORCID record at
-email.welcome.next_steps.1.description.1.2=and add more information to your record. If you haven't already done so, we strongly recommend that you add more than one email address to your account, since our system checks names and email addresses to prevent the creation of duplicate records.
-email.welcome.next_steps.1.description.2=Funders, publishers, universities, and others use the information contained in your ORCID record to help reduce the record-keeping they ask from you. Increase the information you can share by adding other names you are known by, professional information such as your affiliation, biography, and keywords, funding you have received, and works you have created or contributed to your record.
-email.welcome.next_steps.1.description.tips=For tips on adding information to your ORCID record see:\n
-email.welcome.next_steps.1.description.tips.1=See our tips for
-email.welcome.next_steps.1.description.tips.1.link.href=https://orcid.org/blog/2015/07/23/six-things-do-now-you%E2%80%99ve-got-orcid-id
-email.welcome.next_steps.1.description.tips.1.link.text=six things to do now that you have an ORCID iD
-email.welcome.next_steps.1.description.tips.2=. For tips on adding information to your ORCID record see:\n
-email.welcome.next_steps.1.description.link.href=https://support.orcid.org/hc/articles/360006896894
-email.welcome.next_steps.1.description.link.text=https://support.orcid.org/hc/articles/360006896894
-
-email.welcome.next_steps.2=2. Use your ORCID iD when publishing, applying for grants, and more
-email.welcome.next_steps.2.description=Many systems ask for your ORCID iD in order to create a link between you and your research outputs and affiliations. Using your ORCID iD, and granting organizations permission to update your record whenever they request this will help you get credit for your work and reduce time spent on future record-keeping.
-email.welcome.need_help=Need Help?
-
-email.welcome.thank_you_for_creating=Thank you for creating your ORCID identifier. Your 16-digit ORCID identifier is
-email.welcome.full_orcid_and_link_public=, and your full ORCID iD and the link to your public record is
-email.welcome.please_verify_your_email=Please verify your email address to complete your registration and gain access to manually edit your record: click the following link and sign into your ORCID record. If you can't click the link, copy and paste it into your browser's address bar.
+email.welcome=Welcome to ORCID
+email.welcome.congrats=Congratulations on creating your new ORCID iD! This persistent digital identifier, that you own and control, will distinguish you from every other researcher and reduce your burden when you use it in manuscript and grant submission systems.
+email.welcome.for_more_information=for more information on how to get the most out of your ORCID record.
email.welcome.please_visit_your=Please visit our
email.welcome.researcher_homepage=researcher homepage
-email.welcome.for_more_information=for more information on how to get the most out of your ORCID record.
+email.welcome.verify.1=Verifying your email address unlocks advanced editing features in your ORCID record. Until then you will only be able to manage your names and email addresses in your ORCID record.
+email.welcome.verify.2=How do I verify my email address?
+email.welcome.verify.3=Simply click the button below to sign into your ORCID record and complete verification.
+email.welcome.verify.4=Or, copy and paste the link below into your browser's address bar:
+email.welcome.visit=Please visit our researcher homepage for more information on how to get the most out of your ORCID record.
+email.welcome.your_id.id=Your ORCID iD:
+email.welcome.your_id.link=Your ORCID record is
diff --git a/orcid-core/src/main/resources/org/orcid/core/template/welcome_email_html_v2.ftl b/orcid-core/src/main/resources/org/orcid/core/template/welcome_email_html_v2.ftl
index e7e997ee7ae..d3aefd6e42d 100644
--- a/orcid-core/src/main/resources/org/orcid/core/template/welcome_email_html_v2.ftl
+++ b/orcid-core/src/main/resources/org/orcid/core/template/welcome_email_html_v2.ftl
@@ -28,13 +28,22 @@
- <@emailMacros.msg "email.welcome.thank_you_for_creating" /><@emailMacros.space />${orcidId}<@emailMacros.msg "email.welcome.full_orcid_and_link_public" /><@emailMacros.space />${baseUri}/${orcidId}
+ <@emailMacros.msg "email.welcome.your_id.id" /><@emailMacros.space />${orcidId}
+ <@emailMacros.msg "email.welcome.your_id.link" /><@emailMacros.space />${baseUri}/${orcidId}
+
+
+
+ <@emailMacros.msg "email.welcome" /><@emailMacros.space />${userName},
+ <@emailMacros.msg "email.welcome.congrats" />
- <@emailMacros.msg "email.welcome.please_verify_your_email" />
+ <@emailMacros.msg "email.welcome.verify.1" />
-
+ <@emailMacros.msg "email.welcome.verify.2" />
+ <@emailMacros.msg "email.welcome.verify.3" />
+
-
-
+
+
+ <@emailMacros.msg "email.welcome.verify.4" />
+
-
-
+
+
<@emailMacros.msg "email.welcome.please_visit_your" /><@emailMacros.space /><@emailMacros.msg "email.welcome.researcher_homepage" /><@emailMacros.space /><@emailMacros.msg "email.welcome.for_more_information" />
diff --git a/orcid-core/src/main/resources/org/orcid/core/template/welcome_email_v2.ftl b/orcid-core/src/main/resources/org/orcid/core/template/welcome_email_v2.ftl
index 23f5ab9c28e..36c0ba7456b 100644
--- a/orcid-core/src/main/resources/org/orcid/core/template/welcome_email_v2.ftl
+++ b/orcid-core/src/main/resources/org/orcid/core/template/welcome_email_v2.ftl
@@ -18,12 +18,22 @@
-->
<#import "email_macros.ftl" as emailMacros />
-<@emailMacros.msg "email.welcome.thank_you_for_creating" /><@emailMacros.space />${orcidId}<@emailMacros.space /><@emailMacros.msg "email.welcome.full_orcid_and_link_public" /><@emailMacros.space />${baseUri}/${orcidId}
+<@emailMacros.msg "email.welcome.your_id.id" /><@emailMacros.space />${orcidId}
+<@emailMacros.msg "email.welcome.your_id.link" /><@emailMacros.space />${baseUri}/${orcidId}
-<@emailMacros.msg "email.welcome.please_verify_your_email" />
+<@emailMacros.msg "email.welcome" /><@emailMacros.space />${userName}
+<@emailMacros.msg "email.welcome.congrats" />
+
+<@emailMacros.msg "email.welcome.verify.1" />
+
+<@emailMacros.msg "email.welcome.verify.2" />
+
+<@emailMacros.msg "email.welcome.verify.3" />
<@emailMacros.msg "email.button" />
+<@emailMacros.msg "email.welcome.verify.4" />
+
${verificationUrl}?lang=${locale}
<@emailMacros.msg "email.welcome.please_visit_your" /><@emailMacros.space /><@emailMacros.msg "email.welcome.researcher_homepage" /><@emailMacros.space /><@emailMacros.msg "email.welcome.for_more_information" />
diff --git a/orcid-core/src/test/resources/test-activities-2.0_rc1.xml b/orcid-core/src/test/resources/test-activities-2.0_rc1.xml
deleted file mode 100644
index d45f3aaa812..00000000000
--- a/orcid-core/src/test/resources/test-activities-2.0_rc1.xml
+++ /dev/null
@@ -1,221 +0,0 @@
-
-
-
-
- 2001-12-31T12:00:00
- 2001-12-31T12:00:00
-
-
- http://orcid.org/8888-8888-8888-8880
- 8888-8888-8888-8880
- orcid.org
-
-
-
- education:department-name
- education:role-title
-
- 2014
- 12
- 20
-
-
- 2014
- 12
- 20
-
-
- common:name
-
- common:city
- common:region
- AF
-
-
- common:disambiguated-organization-identifier
- common:disambiguation-source
-
-
-
-
-
-
- 2001-12-31T12:00:00
- 2001-12-31T12:00:00
-
-
- http://orcid.org/8888-8888-8888-8880
- 8888-8888-8888-8880
- orcid.org
-
-
-
- affiliation:department-name
- affiliation:role-title
-
- 2014
- 12
- 20
-
-
- 2014
- 12
- 20
-
-
- common:name
-
- common:city
- common:region
- AF
-
-
- common:disambiguated-organization-identifier
- common:disambiguation-source
-
-
-
-
-
-
-
-
- agr
- activities:external-identifier-id
-
-
-
- 2001-12-31T12:00:00
- 2001-12-31T12:00:00
-
-
- http://orcid.org/8888-8888-8888-8880
- 8888-8888-8888-8880
- orcid.org
-
-
-
-
- common:title
- common:translated-title
-
-
-
- http://tempuri.org
- self
- grant_number
- funding:external-identifier-value
-
-
- grant
-
- 2014
- 12
- 20
-
-
- 2014
- 12
- 20
-
-
-
-
-
-
-
-
- agr
- activities:external-identifier-id
-
-
-
- 2001-12-31T12:00:00
- 2001-12-31T12:00:00
-
-
- http://orcid.org/8888-8888-8888-8880
- 8888-8888-8888-8880
- orcid.org
-
-
-
-
-
- http://orcid.org
- self
- agr
- work:external-identifier-id
-
-
-
- 1948
- 02
- 02
-
- issn:1119191
-
- common:name
-
- common:city
- common:region
- AF
-
-
- common:disambiguated-organization-identifier
- common:disambiguation-source
-
-
-
-
-
-
-
-
-
- agr
- activities:external-identifier-id
-
-
-
- 2001-12-31T12:00:00
- 2005-11-12T12:00:00
-
-
- http://orcid.org/8888-8888-8888-8880
- 8888-8888-8888-8880
- orcid.org
-
-
-
-
- common:title
-
- common:translated-title
-
-
-
- http://orcid.org
- self
- agr
- work:external-identifier-id
-
-
- artistic-performance
-
- 1948
- 02
- 02
-
-
-
-
-
\ No newline at end of file
diff --git a/orcid-core/src/test/resources/test-activities-2.0_rc2.xml b/orcid-core/src/test/resources/test-activities-2.0_rc2.xml
deleted file mode 100644
index 9345b990ba3..00000000000
--- a/orcid-core/src/test/resources/test-activities-2.0_rc2.xml
+++ /dev/null
@@ -1,230 +0,0 @@
-
-
- 2005-11-12T12:00:00
-
- 2001-12-31T12:00:00
-
- 2001-12-31T12:00:00
- 2001-12-31T12:00:00
-
-
- http://orcid.org/8888-8888-8888-8880
- 8888-8888-8888-8880
- orcid.org
-
-
-
- education:department-name
- education:role-title
-
- 2014
- 12
- 20
-
-
- 2014
- 12
- 20
-
-
- common:name
-
- common:city
- common:region
- AF
-
-
- common:disambiguated-organization-identifier
- common:disambiguation-source
-
-
-
-
-
- 2001-12-31T12:00:00
-
- 2001-12-31T12:00:00
- 2001-12-31T12:00:00
-
-
- http://orcid.org/8888-8888-8888-8880
- 8888-8888-8888-8880
- orcid.org
-
-
-
- affiliation:department-name
- affiliation:role-title
-
- 2014
- 12
- 20
-
-
- 2014
- 12
- 20
-
-
- common:name
-
- common:city
- common:region
- AF
-
-
- common:disambiguated-organization-identifier
- common:disambiguation-source
-
-
-
-
-
- 2001-12-31T12:00:00
-
- 2001-12-31T12:00:00
-
-
- agr
- activities:external-identifier-id
-
-
-
- 2001-12-31T12:00:00
- 2001-12-31T12:00:00
-
-
- http://orcid.org/8888-8888-8888-8880
- 8888-8888-8888-8880
- orcid.org
-
-
-
-
- common:title
- common:translated-title
-
-
-
- grant_number
- funding:external-identifier-value
- http://tempuri.org
- self
-
-
- grant
-
- 2014
- 12
- 20
-
-
- 2014
- 12
- 20
-
-
-
-
-
- 2001-12-31T12:00:00
-
- 2001-12-31T12:00:00
-
-
- agr
- activities:external-identifier-id
-
-
-
- 2001-12-31T12:00:00
- 2001-12-31T12:00:00
-
-
- http://orcid.org/8888-8888-8888-8880
- 8888-8888-8888-8880
- orcid.org
-
-
-
-
-
- agr
- work:external-identifier-id
- http://orcid.org
- self
-
-
-
- 1948
- 02
- 02
-
- issn:1119191
-
- common:name
-
- common:city
- common:region
- AF
-
-
- common:disambiguated-organization-identifier
- common:disambiguation-source
-
-
-
-
-
-
- 2005-11-12T12:00:00
-
- 2005-11-12T12:00:00
-
-
- agr
- activities:external-identifier-id
-
-
-
- 2001-12-31T12:00:00
- 2005-11-12T12:00:00
-
-
- http://orcid.org/8888-8888-8888-8880
- 8888-8888-8888-8880
- orcid.org
-
-
-
-
- common:title
-
- common:translated-title
-
-
-
- agr
- work:external-identifier-id
- http://orcid.org
- self
-
-
- artistic-performance
-
- 1948
- 02
- 02
-
-
-
-
-
\ No newline at end of file
diff --git a/orcid-core/src/test/resources/test-activities-2.0_rc3.xml b/orcid-core/src/test/resources/test-activities-2.0_rc3.xml
deleted file mode 100644
index fdfbcf226a5..00000000000
--- a/orcid-core/src/test/resources/test-activities-2.0_rc3.xml
+++ /dev/null
@@ -1,230 +0,0 @@
-
-
- 2005-11-12T12:00:00
-
- 2001-12-31T12:00:00
-
- 2001-12-31T12:00:00
- 2001-12-31T12:00:00
-
-
- http://orcid.org/8888-8888-8888-8880
- 8888-8888-8888-8880
- orcid.org
-
-
-
- education:department-name
- education:role-title
-
- 2014
- 12
- 20
-
-
- 2014
- 12
- 20
-
-
- common:name
-
- common:city
- common:region
- AF
-
-
- common:disambiguated-organization-identifier
- common:disambiguation-source
-
-
-
-
-
- 2001-12-31T12:00:00
-
- 2001-12-31T12:00:00
- 2001-12-31T12:00:00
-
-
- http://orcid.org/8888-8888-8888-8880
- 8888-8888-8888-8880
- orcid.org
-
-
-
- affiliation:department-name
- affiliation:role-title
-
- 2014
- 12
- 20
-
-
- 2014
- 12
- 20
-
-
- common:name
-
- common:city
- common:region
- AF
-
-
- common:disambiguated-organization-identifier
- common:disambiguation-source
-
-
-
-
-
- 2001-12-31T12:00:00
-
- 2001-12-31T12:00:00
-
-
- agr
- activities:external-identifier-id
-
-
-
- 2001-12-31T12:00:00
- 2001-12-31T12:00:00
-
-
- http://orcid.org/8888-8888-8888-8880
- 8888-8888-8888-8880
- orcid.org
-
-
-
-
- common:title
- common:translated-title
-
-
-
- grant_number
- funding:external-identifier-value
- http://tempuri.org
- self
-
-
- grant
-
- 2014
- 12
- 20
-
-
- 2014
- 12
- 20
-
-
-
-
-
- 2001-12-31T12:00:00
-
- 2001-12-31T12:00:00
-
-
- agr
- activities:external-identifier-id
-
-
-
- 2001-12-31T12:00:00
- 2001-12-31T12:00:00
-
-
- http://orcid.org/8888-8888-8888-8880
- 8888-8888-8888-8880
- orcid.org
-
-
-
-
-
- agr
- work:external-identifier-id
- http://orcid.org
- self
-
-
-
- 1948
- 02
- 02
-
- issn:1119191
-
- common:name
-
- common:city
- common:region
- AF
-
-
- common:disambiguated-organization-identifier
- common:disambiguation-source
-
-
-
-
-
-
- 2005-11-12T12:00:00
-
- 2005-11-12T12:00:00
-
-
- agr
- activities:external-identifier-id
-
-
-
- 2001-12-31T12:00:00
- 2005-11-12T12:00:00
-
-
- http://orcid.org/8888-8888-8888-8880
- 8888-8888-8888-8880
- orcid.org
-
-
-
-
- common:title
-
- common:translated-title
-
-
-
- agr
- work:external-identifier-id
- http://orcid.org
- self
-
-
- artistic-performance
-
- 1948
- 02
- 02
-
-
-
-
-
\ No newline at end of file
diff --git a/orcid-core/src/test/resources/test-activities-2.0_rc4.xml b/orcid-core/src/test/resources/test-activities-2.0_rc4.xml
deleted file mode 100644
index 288258d26c7..00000000000
--- a/orcid-core/src/test/resources/test-activities-2.0_rc4.xml
+++ /dev/null
@@ -1,230 +0,0 @@
-
-
- 2005-11-12T12:00:00
-
- 2001-12-31T12:00:00
-
- 2001-12-31T12:00:00
- 2001-12-31T12:00:00
-
-
- http://orcid.org/8888-8888-8888-8880
- 8888-8888-8888-8880
- orcid.org
-
-
-
- education:department-name
- education:role-title
-
- 2014
- 12
- 20
-
-
- 2014
- 12
- 20
-
-
- common:name
-
- common:city
- common:region
- AF
-
-
- common:disambiguated-organization-identifier
- common:disambiguation-source
-
-
-
-
-
- 2001-12-31T12:00:00
-
- 2001-12-31T12:00:00
- 2001-12-31T12:00:00
-
-
- http://orcid.org/8888-8888-8888-8880
- 8888-8888-8888-8880
- orcid.org
-
-
-
- affiliation:department-name
- affiliation:role-title
-
- 2014
- 12
- 20
-
-
- 2014
- 12
- 20
-
-
- common:name
-
- common:city
- common:region
- AF
-
-
- common:disambiguated-organization-identifier
- common:disambiguation-source
-
-
-
-
-
- 2001-12-31T12:00:00
-
- 2001-12-31T12:00:00
-
-
- agr
- activities:external-identifier-id
-
-
-
- 2001-12-31T12:00:00
- 2001-12-31T12:00:00
-
-
- http://orcid.org/8888-8888-8888-8880
- 8888-8888-8888-8880
- orcid.org
-
-
-
-
- common:title
- common:translated-title
-
-
-
- grant_number
- funding:external-identifier-value
- http://tempuri.org
- self
-
-
- grant
-
- 2014
- 12
- 20
-
-
- 2014
- 12
- 20
-
-
-
-
-
- 2001-12-31T12:00:00
-
- 2001-12-31T12:00:00
-
-
- agr
- activities:external-identifier-id
-
-
-
- 2001-12-31T12:00:00
- 2001-12-31T12:00:00
-
-
- http://orcid.org/8888-8888-8888-8880
- 8888-8888-8888-8880
- orcid.org
-
-
-
-
-
- agr
- work:external-identifier-id
- http://orcid.org
- self
-
-
-
- 1948
- 02
- 02
-
- issn:1119191
-
- common:name
-
- common:city
- common:region
- AF
-
-
- common:disambiguated-organization-identifier
- common:disambiguation-source
-
-
-
-
-
-
- 2005-11-12T12:00:00
-
- 2005-11-12T12:00:00
-
-
- agr
- activities:external-identifier-id
-
-
-
- 2001-12-31T12:00:00
- 2005-11-12T12:00:00
-
-
- http://orcid.org/8888-8888-8888-8880
- 8888-8888-8888-8880
- orcid.org
-
-
-
-
- common:title
-
- common:translated-title
-
-
-
- agr
- work:external-identifier-id
- http://orcid.org
- self
-
-
- artistic-performance
-
- 1948
- 02
- 02
-
-
-
-
-
\ No newline at end of file
diff --git a/orcid-web/src/main/java/org/orcid/frontend/email/RecordEmailSender.java b/orcid-web/src/main/java/org/orcid/frontend/email/RecordEmailSender.java
index b3a4d049f1b..ec3333351b0 100644
--- a/orcid-web/src/main/java/org/orcid/frontend/email/RecordEmailSender.java
+++ b/orcid-web/src/main/java/org/orcid/frontend/email/RecordEmailSender.java
@@ -89,37 +89,16 @@ public void sendWelcomeEmail(String userOrcid, String email) {
String subject = messages.getMessage("email.subject.register.welcome", null, userLocale);
- String emailName = recordNameManager.deriveEmailFriendlyName(userOrcid);
+ String userName = recordNameManager.deriveEmailFriendlyName(userOrcid);
String verificationUrl = verifyEmailUtils.createVerificationUrl(email, orcidUrlManager.getBaseUrl());
String orcidId = userOrcid;
String baseUri = orcidUrlManager.getBaseUrl();
- String baseUriHttp = orcidUrlManager.getBaseUriHttp();
-
+
templateParams.put("subject", subject);
- templateParams.put("emailName", emailName);
+ templateParams.put("userName", userName);
templateParams.put("verificationUrl", verificationUrl);
templateParams.put("orcidId", orcidId);
- templateParams.put("baseUri", baseUri);
- templateParams.put("baseUriHttp", baseUriHttp);
-
- SourceEntity source = sourceManager.retrieveActiveSourceEntity();
- if (source != null) {
- String sourceId = SourceEntityUtils.getSourceId(source);
- String sourceName = sourceEntityUtils.getSourceName(source);
- // If the source is not the user itself
- if (sourceId != null && !sourceId.equals(orcidId)) {
- if (!PojoUtil.isEmpty(sourceName)) {
- String paramValue = " " + messages.getMessage("common.through", null, userLocale) + " " + sourceName + ".";
- templateParams.put("source_name_if_exists", paramValue);
- } else {
- templateParams.put("source_name_if_exists", ".");
- }
- } else {
- templateParams.put("source_name_if_exists", ".");
- }
- } else {
- templateParams.put("source_name_if_exists", ".");
- }
+ templateParams.put("baseUri", baseUri);
verifyEmailUtils.addMessageParams(templateParams, userLocale);
@@ -127,7 +106,7 @@ public void sendWelcomeEmail(String userOrcid, String email) {
String body = templateManager.processTemplate("welcome_email_v2.ftl", templateParams);
// Generate html from template
String html = templateManager.processTemplate("welcome_email_html_v2.ftl", templateParams);
-
+
mailgunManager.sendEmail(EmailConstants.DO_NOT_REPLY_VERIFY_ORCID_ORG, email, subject, body, html);
}
diff --git a/orcid-web/src/test/java/org/orcid/frontend/email/RecordEmailSenderTest.java b/orcid-web/src/test/java/org/orcid/frontend/email/RecordEmailSenderTest.java
index 2aace4025a2..395525982bd 100644
--- a/orcid-web/src/test/java/org/orcid/frontend/email/RecordEmailSenderTest.java
+++ b/orcid-web/src/test/java/org/orcid/frontend/email/RecordEmailSenderTest.java
@@ -4,6 +4,8 @@
import static org.mockito.ArgumentMatchers.anyString;
import static org.mockito.ArgumentMatchers.eq;
import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.times;
+import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
import java.io.IOException;
@@ -22,6 +24,7 @@
import org.mockito.MockitoAnnotations;
import org.orcid.core.adapter.v3.JpaJaxbNotificationAdapter;
import org.orcid.core.common.manager.EmailFrequencyManager;
+import org.orcid.core.constants.EmailConstants;
import org.orcid.core.manager.EncryptionManager;
import org.orcid.core.manager.ProfileEntityCacheManager;
import org.orcid.core.manager.v3.EmailManager;
@@ -106,6 +109,7 @@ public void before() {
ReflectionTestUtils.setField(recordEmailSender, "emailManager", mockEmailManager);
ReflectionTestUtils.setField(recordEmailSender, "recordNameManager", mockRecordNameManager);
ReflectionTestUtils.setField(recordEmailSender, "profileEventDao", mockProfileEventDao);
+ ReflectionTestUtils.setField(recordEmailSender, "mailgunManager", mockMailGunManager);
}
@@ -114,8 +118,10 @@ public void testSendWelcomeEmail() throws JAXBException, IOException, URISyntaxE
Email email = new Email();
email.setEmail("josiah_carberry@brown.edu");
when(mockEmailManager.findPrimaryEmail(anyString())).thenReturn(email);
-
+
recordEmailSender.sendWelcomeEmail("4444-4444-4444-4446", "josiah_carberry@brown.edu");
+
+ verify(mockMailGunManager, times(1)).sendEmail(eq(EmailConstants.DO_NOT_REPLY_VERIFY_ORCID_ORG), eq("josiah_carberry@brown.edu"), eq("[ORCID] Welcome to ORCID"), anyString(), anyString());
}
@Test