Skip to content

Commit

Permalink
Add a welcome email
Browse files Browse the repository at this point in the history
  • Loading branch information
Flaburgan committed Nov 5, 2022
1 parent 2fe5a7b commit 44c5300
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 1 deletion.
1 change: 1 addition & 0 deletions app/controllers/registrations_controller.rb
Expand Up @@ -17,6 +17,7 @@ def create
@user.process_invite_acceptence(invite) if invite.present?
@user.seed_aspects
@user.send_welcome_message
WelcomeMailer.send_welcome_email(@user).deliver_now
sign_in_and_redirect(:user, @user)
logger.info "event=registration status=successful user=#{@user.diaspora_handle}"
else
Expand Down
10 changes: 10 additions & 0 deletions app/mailers/welcome_mailer.rb
@@ -0,0 +1,10 @@
# frozen_string_literal: true

class WelcomeMailer < ApplicationMailer
def send_welcome_email(user)
@user = user
mail(to: @user.email, subject: I18n.t("registrations.welcome_email.subject")) do |format|
format.html { render "registrations/welcome_email" }
end
end
end
11 changes: 11 additions & 0 deletions app/views/registrations/welcome_email.haml
@@ -0,0 +1,11 @@
%h1
!= t("registrations.welcome_email.member")
%p
!= t("registrations.welcome_email.part_of_network", pod_url: link_to(AppConfig.pod_uri.site, AppConfig.pod_uri.site),
username: @user.username)
%p
!= t("registrations.welcome_email.your_id", id: @user.person.diaspora_handle)
%p
!= t("registrations.welcome_email.help")
%p
!= t("registrations.welcome_email.welcome")
8 changes: 7 additions & 1 deletion config/locales/diaspora/en.yml
Expand Up @@ -1111,7 +1111,13 @@ en:
find_pods: "There’s a list of pods you can sign up to at %{fediverse_observer}."
other_questions: "If you have any other questions regarding choosing a pod, check out our %{wiki}."
invalid_invite: "The invite link you provided is no longer valid!"

welcome_email:
subject: "Welcome aboard!"
member: "You now are a member of the diaspora* community!"
part_of_network: "%{pod_url} is the diaspora* server (called a pod) where you registered. Sign in there using your username, %{username}. Once logged in, you will be able to reach the whole diaspora* network, even users registered on other pods."
your_id: "Your diaspora* id is %{id}, share it with everyone so they can find you in the network."
help: "If you need help, have a look at the tutorials or the help section. If you don't find anything, then post a public message with the #question tag so people can help you."
welcome: "Welcome aboard, enjoy diaspora*!"
reshares:
create:
error: "Failed to reshare."
Expand Down

0 comments on commit 44c5300

Please sign in to comment.