Class: Notify
- Inherits:
-
ApplicationMailer
- Object
- ActionMailer::Base
- ApplicationMailer
- Notify
- Includes:
- ActionDispatch::Routing::PolymorphicRoutes, Emails::AdminNotification, Emails::AutoDevops, Emails::Groups, Emails::IdentityVerification, Emails::Imports, Emails::Issues, Emails::Members, Emails::MergeRequests, Emails::Notes, Emails::PagesDomains, Emails::Pipelines, Emails::Profile, Emails::Projects, Emails::Releases, Emails::RemoteMirrors, Emails::Reviews, Emails::ServiceDesk, Emails::Shared, Emails::WorkItems, EmailsHelper, GitlabRoutingHelper, IssuablesHelper
- Defined in:
- app/mailers/notify.rb
Direct Known Subclasses
Constant Summary
Constants included from Emails::ServiceDesk
Emails::ServiceDesk::EMAIL_ATTACHMENTS_SIZE_LIMIT, Emails::ServiceDesk::VERIFICATION_EMAIL_TIMEOUT
Constants included from Routing::PseudonymizationHelper
Routing::PseudonymizationHelper::PSEUDONOMIZED_GROUP, Routing::PseudonymizationHelper::PSEUDONOMIZED_ID, Routing::PseudonymizationHelper::PSEUDONOMIZED_NAMESPACE, Routing::PseudonymizationHelper::PSEUDONOMIZED_PROJECT
Constants included from ProjectsHelper
Instance Attribute Summary
Attributes inherited from ApplicationMailer
Class Method Summary collapse
-
.allowed_email_domains ⇒ Object
Splits “gitlab.corp.company.com” up into “gitlab.corp.company.com”, “corp.company.com” and “company.com”.
Instance Method Summary collapse
Methods included from Emails::WorkItems
#export_work_items_csv_email, #import_work_items_csv_email
Methods included from Emails::Imports
#bulk_import_complete, #bulk_import_csv_user_mapping, #github_gists_import_errors_email, #import_source_user_reassign, #import_source_user_rejected
Methods included from Emails::IdentityVerification
#verification_instructions_email
Methods included from Gitlab::Email::SingleRecipientValidator
#validate_single_recipient_in_email, #validate_single_recipient_in_email!, #validate_single_recipient_in_opts!
Methods included from Emails::AdminNotification
#send_admin_notification, #send_unsubscribed_notification
Methods included from Emails::ServiceDesk
#service_desk_custom_email_verification_email, #service_desk_new_note_email, #service_desk_new_participant_email, #service_desk_thank_you_email, #service_desk_verification_result_email, #service_desk_verification_triggered_email
Methods included from MarkupHelper
#cross_project_reference, #first_line_in_markdown, #link_to_html, #link_to_markdown, #link_to_markdown_field, #markdown, #markdown_field, #markup, #render_wiki_content
Methods included from Emails::Reviews
Methods included from Emails::Groups
#group_email, #group_was_exported_email, #group_was_not_exported_email
Methods included from Emails::Releases
Methods included from Emails::RemoteMirrors
#remote_mirror_update_failed_email
Methods included from Emails::AutoDevops
Methods included from Emails::Members
#member, #member_about_to_expire_email, #member_access_granted_email, #member_access_requested_email, #member_expiration_date_updated_email, #member_invite_accepted_email, #member_invite_declined_email, #member_source, #member_source_organization, #notification_group
Methods included from MembersHelper
#leave_confirmation_message, #member_path, #remove_member_message
Methods included from Emails::Pipelines
#pipeline_failed_email, #pipeline_fixed_email, #pipeline_success_email
Methods included from Emails::Profile
#access_token_about_to_expire_email, #access_token_created_email, #access_token_expired_email, #access_token_revoked_email, #bot_resource_access_token_about_to_expire_email, #disabled_two_factor_email, #instance_access_request_email, #new_achievement_email, #new_email_address_added_email, #new_gpg_key_email, #new_ssh_key_email, #new_user_email, #ssh_key_expired_email, #ssh_key_expiring_soon_email, #two_factor_otp_attempt_failed_email, #unknown_sign_in_email, #user_admin_rejection_email, #user_deactivated_email
Methods included from SafeFormatHelper
Methods included from Emails::Projects
#inactive_project_deletion_warning_email, #project_was_exported_email, #project_was_moved_email, #project_was_not_exported_email, #prometheus_alert_fired_email, #repository_cleanup_failure_email, #repository_cleanup_success_email, #repository_push_email, #repository_rewrite_history_failure_email, #repository_rewrite_history_success_email
Methods included from Emails::PagesDomains
#pages_domain_auto_ssl_failed_email, #pages_domain_disabled_email, #pages_domain_enabled_email, #pages_domain_verification_failed_email, #pages_domain_verification_succeeded_email
Methods included from Emails::Notes
#note_commit_email, #note_design_email, #note_issue_email, #note_merge_request_email, #note_snippet_email
Methods included from Emails::MergeRequests
#approved_merge_request_email, #change_in_merge_request_draft_status_email, #changed_milestone_merge_request_email, #changed_reviewer_of_merge_request_email, #closed_merge_request_email, #merge_request_status_email, #merge_request_unmergeable_email, #merge_requests_csv_email, #merge_when_pipeline_succeeds_email, #merged_merge_request_email, #new_mention_in_merge_request_email, #new_merge_request_email, #push_to_merge_request_email, #reassigned_merge_request_email, #relabeled_merge_request_email, #removed_milestone_merge_request_email, #request_review_merge_request_email, #resolved_all_discussions_email, #unapproved_merge_request_email
Methods included from Emails::Issues
#changed_milestone_issue_email, #closed_issue_email, #import_issues_csv_email, #issue_cloned_email, #issue_due_email, #issue_moved_email, #issue_status_changed_email, #issues_csv_email, #new_issue_email, #new_mention_in_issue_email, #reassigned_issue_email, #relabeled_issue_email, #removed_milestone_issue_email
Methods included from Emails::Shared
Methods included from IssuablesHelper
#assigned_issuables_count, #assignees_label, #close_issuable_path, #group_dropdown_label, #has_filter_bar_param?, #issuable_author_is_current_user, #issuable_initial_data, #issuable_label_selector_data, #issuable_path, #issuable_project_reference, #issuable_reference, #issuable_squash_option?, #issuable_type_selector_data, #issuables_count_for_state, #issuables_state_counter_text, #multi_label_name, #project_dropdown_label, #reopen_issuable_path, #serialize_issuable, #sidebar_gutter_collapsed_class, #sidebar_gutter_toggle_icon, #sidebar_gutter_tooltip_text, #user_dropdown_label, #users_dropdown_label
Methods included from Sidebars::Concerns::HasPill
#format_cached_count, #has_pill?, #pill_count, #pill_count_field, #pill_html_options
Methods included from IssuablesDescriptionTemplatesHelper
#available_service_desk_templates_for, #default_template_name, #issuable_templates, #selected_template_name, #template_dropdown_tag, #template_names, #template_names_path
Methods included from Routing::PackagesHelper
Methods included from Routing::PseudonymizationHelper
#masked_page_url, #masked_query_params, #masked_referrer_url, #referrer_params
Methods included from Routing::GraphqlHelper
#graphql_etag_pipeline_path, #graphql_etag_pipeline_sha_path, #graphql_etag_project_on_demand_scan_counts_path
Methods included from Routing::WikiHelper
#group_wiki_page_url, #project_wiki_page_url, #wiki_page_path, #wiki_path
Methods included from Routing::SnippetsHelper
#gitlab_dashboard_snippets_path, #gitlab_raw_snippet_blob_path, #gitlab_raw_snippet_blob_url, #gitlab_raw_snippet_path, #gitlab_raw_snippet_url, #gitlab_snippet_note_path, #gitlab_snippet_note_url, #gitlab_snippet_notes_path, #gitlab_snippet_notes_url, #gitlab_snippet_path, #gitlab_snippet_url, #gitlab_toggle_award_emoji_snippet_note_path, #gitlab_toggle_award_emoji_snippet_note_url, #gitlab_toggle_award_emoji_snippet_path, #gitlab_toggle_award_emoji_snippet_url, #preview_markdown_path, #toggle_award_emoji_personal_snippet_path, #toggle_award_emoji_project_project_snippet_path, #toggle_award_emoji_project_project_snippet_url
Methods included from Routing::PipelineSchedulesHelper
#edit_pipeline_schedule_path, #pipeline_schedule_path, #pipeline_schedules_path, #play_pipeline_schedule_path, #take_ownership_pipeline_schedule_path
Methods included from Routing::ArtifactsHelper
#artifacts_action_path, #expose_fast_artifacts_path, #fast_browse_project_job_artifacts_path, #fast_download_project_job_artifacts_path, #fast_keep_project_job_artifacts_path
Methods included from Routing::MembersHelper
Methods included from Routing::Groups::MembersHelper
#approve_access_request_group_member_path, #group_member_path, #group_members_url, #leave_group_members_path, #request_access_group_members_path, #resend_invite_group_member_path
Methods included from Routing::Projects::MembersHelper
#approve_access_request_project_member_path, #leave_project_members_path, #project_member_path, #project_members_url, #request_access_project_members_path, #resend_invite_project_member_path
Methods included from Routing::ProjectsHelper
#commit_url, #commits_url, #edit_milestone_path, #environment_delete_path, #environment_path, #issue_path, #issue_url, #merge_request_path, #merge_request_url, #pipeline_job_url, #pipeline_path, #pipeline_url, #project_commits_path, #project_ref_path, #project_tree_path, #release_url, #toggle_subscription_path, #work_item_url
Methods included from API::Helpers::RelatedResourcesHelpers
#expose_path, #expose_url, #issues_available?, #mrs_available?, #project_feature_string_access_level
Methods included from ApplicationSettingsHelper
#all_protocols_enabled?, #allowed_protocols_present?, #anti_spam_service_enabled?, #deprecated_attributes, #enabled_protocol, #enabled_protocol_button, #expanded_by_default?, #external_authorization_allow_token_help_text, #external_authorization_client_certificate_help_text, #external_authorization_client_key_help_text, #external_authorization_client_pass_help_text, #external_authorization_client_url_help_text, #external_authorization_description, #external_authorization_service_attributes, #external_authorization_timeout_help_text, #external_authorization_url_help_text, #http_enabled?, #import_sources_checkboxes, #instance_clusters_enabled?, #integration_expanded?, #key_restriction_options_for_select, #kroki_available_formats, #oauth_providers_checkboxes, #pending_user_count, #registration_features_can_be_prompted?, #repository_storages_options_json, #restricted_level_checkboxes, #runner_token_expiration_interval_attributes, #sidekiq_job_limiter_mode_help_text, #sidekiq_job_limiter_modes_for_select, #signup_enabled?, #signup_form_data, #ssh_enabled?, #storage_weights, #user_oauth_applications?, #valid_runner_registrars, #visible_attributes
Methods included from ProjectsHelper
#able_to_see_forks_count?, #able_to_see_issues?, #able_to_see_merge_requests?, #any_projects?, #author_content_tag, #autodeploy_flash_notice, #badge_count, #branch_rules_path, #can_admin_associated_clusters?, #can_admin_project_member?, #can_change_visibility_level?, #can_disable_emails?, #can_push_code?, #can_set_diff_preview_in_email?, #can_view_branch_rules?, #clusters_deprecation_alert_message, #dashboard_projects_app_data, #delete_confirm_phrase, #directory?, #error_tracking_setting_project_json, #explore_projects_tab?, #external_classification_label_help_message, #fork_button_data_attributes, #hidden_issue_icon, #home_panel_data_attributes, #http_clone_url_to_repo, #import_from_bitbucket_message, #inactive_project_deletion_date, #issue_css_classes, #issue_manual_ordering_class, #last_pipeline_from_status_cache, #last_push_event, #link_to_autodeploy_doc, #link_to_data_loss_doc, #link_to_member, #link_to_member_avatar, #link_to_namespace_change_doc, #link_to_project, #load_catalog_resources, #load_pipeline_status, #localized_project_human_access, #membership_locked?, #no_password_message, #notification_data_attributes, #project_can_be_shared?, #project_classes, #project_coverage_chart_data_attributes, #project_incident_management_setting, #project_license_name, #project_permissions_panel_data, #project_title, #projects_filtered_search_and_sort_app_data, #push_to_create_project_command, #remote_mirror_setting_enabled?, #remove_fork_project_confirm_json, #remove_fork_project_description_message, #remove_fork_project_warning_message, #remove_project_message, #show_archived_project_banner?, #show_auto_devops_implicitly_enabled_banner?, #show_clusters_alert?, #show_count?, #show_dashboard_projects_welcome_page?, #show_inactive_project_deletion_banner?, #show_invalid_gpg_key_message?, #show_lfs_misconfiguration_banner?, #show_mobile_devops_project_promo?, #show_no_password_message?, #show_no_ssh_key_message?, #show_projects?, #show_terraform_banner?, #show_xcode_link?, #ssh_clone_url_to_repo, #star_count_data_attributes, #transfer_project_confirm_button, #transfer_project_message, #visibility_level_content, #visible_fork_source, #vue_fork_divergence_data, #xcode_uri_to_repo
Methods included from Gitlab::Allowable
Methods included from CompareHelper
#create_mr_button?, #create_mr_path, #project_compare_selector_data, #target_projects
Methods included from EmailsHelper
#action_title, #admin_changed_password_text, #change_reviewer_notification_text, #closure_reason_text, #contact_your_administrator_text, #create_list_id_string, #email_action, #email_default_heading, #gmail_goto_action, #group_membership_expiration_changed_link, #group_membership_expiration_changed_text, #header_logo, #html_footer_message, #html_header_message, #instance_access_request_link, #instance_access_request_text, #link_end, #link_start, #member_about_to_expire_link, #member_about_to_expire_text, #new_email_address_added_text, #notification_reason_text, #password_reset_token_valid_time, #re_enable_two_factor_authentication_text, #remove_email_address_text, #sanitize_name, #say_hello, #say_hi, #service_desk_email_additional_text, subject_with_suffix, #text_footer_message, #text_header_message, #two_factor_authentication_disabled_text
Methods included from AppearancesHelper
#appearance_apple_touch_icon, #appearance_maskable_logo, #appearance_pwa_description, #appearance_pwa_icon_path_scaled, #appearance_pwa_name, #appearance_pwa_short_name, #append_root_path, #brand_header_logo, #brand_image, #brand_image_path, #brand_member_guidelines, #brand_new_project_guidelines, #brand_profile_image_guidelines, #brand_title, #current_appearance, #custom_sign_in_description, #default_brand_title, #footer_message, #header_message
Methods inherited from ApplicationMailer
Class Method Details
.allowed_email_domains ⇒ Object
Splits “gitlab.corp.company.com” up into “gitlab.corp.company.com”, “corp.company.com” and “company.com”. Respects set tld length so “company.co.uk” won’t match “somethingelse.uk”
58 59 60 61 62 63 64 65 66 67 |
# File 'app/mailers/notify.rb', line 58 def self.allowed_email_domains domain_parts = Gitlab.config.gitlab.host.split(".") allowed_domains = [] begin allowed_domains << domain_parts.join(".") domain_parts.shift end while domain_parts.length > ActionDispatch::Http::URL.tld_length allowed_domains end |
Instance Method Details
#can_send_from_user_email?(sender) ⇒ Boolean
69 70 71 72 |
# File 'app/mailers/notify.rb', line 69 def can_send_from_user_email?(sender) sender_domain = sender.email.split("@").last self.class.allowed_email_domains.include?(sender_domain) end |
#test_email(recipient_email, subject, body) ⇒ Object
46 47 48 49 50 51 52 53 |
# File 'app/mailers/notify.rb', line 46 def test_email(recipient_email, subject, body) mail_with_locale( to: recipient_email, subject: subject, body: body.html_safe, content_type: 'text/html' ) end |