Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP:Add a welcome email #7823

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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