-
Notifications
You must be signed in to change notification settings - Fork 39
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* SRCH-1266 - Create first_name last_name column in users table
- Loading branch information
Showing
48 changed files
with
698 additions
and
571 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
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 |
---|---|---|
|
@@ -11,11 +11,10 @@ class Emailer < ApplicationMailer | |
|
||
def new_user_to_admin(user) | ||
@user = user | ||
@user_contact_name = user.contact_name.presence || user.email | ||
@user_contact_name = get_contact_name(user) | ||
|
||
if @user.affiliates.any? | ||
@user_inviter_contact_name = @user.inviter.contact_name.presence || | ||
@user.inviter.email | ||
@user_inviter_contact_name = get_contact_name(@user.inviter) | ||
end | ||
|
||
setup_email('[email protected]', __method__) | ||
|
@@ -34,38 +33,38 @@ def new_feature_adoption_to_admin | |
def account_deactivation_warning(user, date) | ||
@user = user | ||
@remaining_days = (date - 90.days.ago.to_date).to_i | ||
@user_contact_name = user.contact_name.presence || user.email | ||
@user_contact_name = get_contact_name(user) | ||
generic_user_html_email(user, __method__) | ||
end | ||
|
||
def user_approval_removed(user) | ||
@user = user | ||
@user_contact_name = user.contact_name.presence || user.email | ||
@user_contact_name = get_contact_name(user) | ||
setup_email("[email protected]", __method__) | ||
send_mail(:text) | ||
end | ||
|
||
def account_deactivated(user) | ||
@user = user | ||
@user_contact_name = user.contact_name.presence || user.email | ||
@user_contact_name = get_contact_name(user) | ||
generic_user_html_email(user, __method__) | ||
end | ||
|
||
def welcome_to_new_user(user) | ||
@new_site_url = new_site_url | ||
@user_contact_name = user.contact_name.presence || user.email | ||
@user_contact_name = get_contact_name(user) | ||
generic_user_html_email(user, __method__) | ||
end | ||
|
||
def new_affiliate_site(affiliate, user) | ||
@affiliate = affiliate | ||
@user_contact_name = user.contact_name.presence || user.email | ||
@user_contact_name = get_contact_name(user) | ||
generic_user_text_email(user, __method__) | ||
end | ||
|
||
def new_affiliate_user(affiliate, user, current_user) | ||
@added_by_contact_name = current_user.contact_name.presence || current_user.email | ||
@added_user_contact_name = user.contact_name.presence || user.email | ||
@added_by_contact_name = get_contact_name(current_user) | ||
@added_user_contact_name = get_contact_name(user) | ||
@affiliate_display_name = affiliate.display_name | ||
@affiliate_name = affiliate.name | ||
@affiliate_site_url = site_url(affiliate) | ||
|
@@ -75,8 +74,8 @@ def new_affiliate_user(affiliate, user, current_user) | |
|
||
def welcome_to_new_user_added_by_affiliate(affiliate, user, current_user) | ||
@account_url = account_url | ||
@added_by_contact_name = current_user.contact_name.presence || current_user.email | ||
@added_user_contact_name = user.contact_name.presence || user.email | ||
@added_by_contact_name = get_contact_name(current_user) | ||
@added_user_contact_name = get_contact_name(user) | ||
@added_user_email = user.email | ||
@affiliate_display_name = affiliate.display_name | ||
@affiliate_site_url = site_url(affiliate) | ||
|
@@ -200,4 +199,9 @@ def generic_user_html_email(user, method) | |
setup_email(user.email, method) | ||
send_mail(:html) | ||
end | ||
|
||
def get_contact_name(user) | ||
full_name = "#{user.first_name} #{user.last_name}" | ||
full_name.presence || user.email | ||
end | ||
end |
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
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
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 |
---|---|---|
|
@@ -2,8 +2,8 @@ Feature: Activate Search | |
|
||
Scenario: Getting an embed code for my affiliate site search | ||
Given the following Affiliates exist: | ||
| display_name | name | contact_email | contact_name | | ||
| aff site | aff.gov | aff@bar.gov | John Bar | | ||
| display_name | name | contact_email | first_name | last_name | | ||
| aff site | aff.gov | aff@bar.gov | John | Bar | | ||
And I am logged in with email "[email protected]" | ||
When I go to the aff.gov's Activate Search page | ||
Then I should see "Form Snippet" | ||
|
@@ -12,25 +12,25 @@ Feature: Activate Search | |
|
||
Scenario: Getting an embed code for my affiliate site search in Spanish | ||
Given the following Affiliates exist: | ||
| display_name | name | contact_email | contact_name | locale | | ||
| aff site | aff.gov | aff@bar.gov | John Bar | es | | ||
| display_name | name | contact_email | first_name | last_name | locale | | ||
| aff site | aff.gov | aff@bar.gov | John | Bar | es | | ||
And I am logged in with email "[email protected]" | ||
When I go to the aff.gov's Activate Search page | ||
Then I should see the code for Spanish language sites | ||
|
||
Scenario: Visiting the Site API Access Key | ||
Given the following Affiliates exist: | ||
| display_name | name | contact_email | contact_name | api_access_key | | ||
| aff site | aff.gov | aff@bar.gov | John Bar | MY_AWESOME_KEY | | ||
| display_name | name | contact_email | first_name | last_name | api_access_key | | ||
| aff site | aff.gov | aff@bar.gov | John | Bar | MY_AWESOME_KEY | | ||
And I am logged in with email "[email protected]" | ||
When I go to the aff.gov's Activate Search page | ||
And I follow "API Access Key" | ||
Then I should see "MY_AWESOME_KEY" | ||
|
||
Scenario: Visiting the Site API Instructions | ||
Given the following Affiliates exist: | ||
| display_name | name | contact_email | contact_name | | ||
| aff site | aff.gov | aff@bar.gov | John Bar | | ||
| display_name | name | contact_email | first_name | last_name | | ||
| aff site | aff.gov | aff@bar.gov | John | Bar | | ||
And affiliate "aff.gov" has the following RSS feeds: | ||
| name | url | | ||
| News-1 | https://www.usa.gov/feed/news-1 | | ||
|
@@ -48,8 +48,8 @@ Feature: Activate Search | |
|
||
Scenario: Visiting the Site i14y Content Indexing API Instructions | ||
Given the following Affiliates exist: | ||
| display_name | name | contact_email | contact_name | gets_i14y_results | | ||
| aff site | aff.gov | aff@bar.gov | John Bar | true | | ||
| display_name | name | contact_email | first_name | last_name | gets_i14y_results | | ||
| aff site | aff.gov | aff@bar.gov | John Bar | Bar | true | | ||
And I am logged in with email "[email protected]" | ||
When I go to the aff.gov's Activate Search page | ||
And I follow "i14y Content Indexing API Instructions" | ||
|
Oops, something went wrong.