## Description Add account delete option in the user account settings. Fixes #1555 ## Type of change - [ ] New feature (non-breaking change which adds functionality)   ## Checklist: - [ ] My code follows the style guidelines of this project - [ ] I have performed a self-review of my own code - [ ] I have commented on my code, particularly in hard-to-understand areas - [ ] I have made corresponding changes to the documentation - [ ] My changes generate no new warnings - [ ] I have added tests that prove my fix is effective or that my feature works - [ ] New and existing unit tests pass locally with my changes - [ ] Any dependent changes have been merged and published in downstream modules --------- Co-authored-by: Sojan Jose <sojan@pepalo.com> Co-authored-by: Sojan Jose <sojan.official@gmail.com> Co-authored-by: Muhsin Keloth <muhsinkeramam@gmail.com>
32 lines
892 B
Ruby
32 lines
892 B
Ruby
class AdministratorNotifications::BaseMailer < ApplicationMailer
|
|
# Common method to check SMTP configuration and send mail with liquid
|
|
def send_notification(subject, to: nil, action_url: nil, meta: {})
|
|
return unless smtp_config_set_or_development?
|
|
|
|
@action_url = action_url
|
|
@meta = meta || {}
|
|
|
|
send_mail_with_liquid(to: to || admin_emails, subject: subject) and return
|
|
end
|
|
|
|
# Helper method to generate inbox URL
|
|
def inbox_url(inbox)
|
|
"#{ENV.fetch('FRONTEND_URL', nil)}/app/accounts/#{Current.account.id}/settings/inboxes/#{inbox.id}"
|
|
end
|
|
|
|
# Helper method to generate settings URL
|
|
def settings_url(section)
|
|
"#{ENV.fetch('FRONTEND_URL', nil)}/app/accounts/#{Current.account.id}/settings/#{section}"
|
|
end
|
|
|
|
private
|
|
|
|
def admin_emails
|
|
Current.account.administrators.pluck(:email)
|
|
end
|
|
|
|
def liquid_locals
|
|
super.merge({ meta: @meta })
|
|
end
|
|
end
|