Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
V
venjob
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Huỳnh Thiên Phước
venjob
Commits
9738679a
Commit
9738679a
authored
Aug 19, 2020
by
Huỳnh Thiên Phước
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
create email sending
parent
c82beab1
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
35 additions
and
27 deletions
+35
-27
app/mailers/application_mailer.rb
+1
-1
app/mailers/user_mailer.rb
+1
-1
app/views/layouts/_header.html.erb
+1
-1
app/views/user_mailer/register_email.html.erb
+4
-9
app/views/user_mailer/register_email.text.erb
+0
-4
app/views/users/mail_register.html.erb
+3
-0
config/environments/development.rb
+7
-6
config/environments/production.rb
+14
-1
config/environments/test.rb
+1
-1
config/local_env.yml.gitignore
+3
-3
No files found.
app/mailers/application_mailer.rb
View file @
9738679a
class
ApplicationMailer
<
ActionMailer
::
Base
default
from:
'phuoc
ht@zigexn.vn
'
default
from:
'phuoc
2811006@gmail.com
'
layout
'mailer'
end
app/mailers/user_mailer.rb
View file @
9738679a
class
UserMailer
<
ActionMailer
::
Base
def
register_email
(
email
)
@email
=
email
mail
(
to:
@email
,
subject:
'Welcome
to My Awesome Site
'
)
mail
(
to:
@email
,
subject:
'Welcome
To VeNJOB! Confirm Your Email
'
)
end
end
app/views/layouts/_header.html.erb
View file @
9738679a
...
...
@@ -5,7 +5,7 @@
<nav>
<ul
class=
"navbar-nav mr-auto"
>
<li>
<%=
link_to
"Login"
,
'#'
,
class:
"nav-item nav-link"
%>
</li>
<li>
<%=
link_to
"Register"
,
'#'
,
class:
"nav-item nav-link"
%>
</li>
<li>
<%=
link_to
"Register"
,
register_begin_path
,
class:
"nav-item nav-link"
%>
</li>
<li>
<%=
link_to
"Favorite"
,
'#'
,
class:
"nav-item nav-link"
%>
</li>
<li>
<%=
link_to
"History"
,
'#'
,
class:
"nav-item nav-link"
%>
</li>
</ul>
...
...
app/views/user_mailer/register_email.html.erb
View file @
9738679a
...
...
@@ -3,14 +3,9 @@
<meta
content=
'text/html; charset=UTF-8'
http-equiv=
'Content-Type'
/>
</head>
<body>
<h1>
Welcome to example.com,
<%=
@email
%>
</h1>
<p>
You have successfully signed up to example.com,
your username is:
<%=
@email
%>
.
<br>
</p>
<p>
To login to the site, just follow this link:....
</p>
<p>
Thanks for joining and have a great day!
</p>
<h1>
Welcome to
<%=
@email
%>
</h1>
<p>
You're on your way!
</p>
<p>
Let's confirm your email address.
</p>
<p>
By clicking on the following link, you are confirming your email address and agreeing to VeNJOB's Terms of Service
</p>
.
</body>
</html>
app/views/user_mailer/register_email.text.erb
deleted
100644 → 0
View file @
c82beab1
=================================================
Welcome to example.com,
<%=
@email
%>
HELLO
app/views/users/mail_register.html.erb
View file @
9738679a
...
...
@@ -3,6 +3,9 @@
<strong>
Register
</strong>
</div>
<div
class=
"row"
>
<div
class=
"text-center waiting-text"
>
</div>
Thank you for register our service, an confirmation email with registration link
<br>
has been sent to your email. Please check your email within 24 hours.
<br>
Please note that the registration link is only valid for 24 hours.
<br>
...
...
config/environments/development.rb
View file @
9738679a
...
...
@@ -31,18 +31,19 @@ Rails.application.configure do
config
.
active_storage
.
service
=
:local
# Don't care if the mailer can't send.
config
.
active_job
.
queue_adapter
=
:async
config
.
action_mailer
.
default_url_options
=
{
host:
"localhost:3000"
}
# config.active_job.queue_adapter = :async
# config.action_mailer.default_options = { from: 'support@venjob.com' }
config
.
action_mailer
.
default_options
=
{
from:
'phuoc2811006@gmail.com'
}
config
.
action_mailer
.
default_url_options
=
{
host:
"localhost:3000"
}
config
.
action_mailer
.
raise_delivery_errors
=
true
config
.
action_mailer
.
perform_deliveries
=
true
config
.
action_mailer
.
delivery_method
=
:smtp
config
.
action_mailer
.
smtp_settings
=
{
address:
"smtp.
zigexn.vn
"
,
address:
"smtp.
gmail.com
"
,
port:
587
,
domain:
"
zigexn.vn
"
,
user_name:
ENV
[
'GMAIL_USERNAME'
]
,
password:
ENV
[
'GMAIL_PASSWORD'
]
,
domain:
"
localhost:3000
"
,
user_name:
"phuoc2811006@gmail.com"
,
password:
"Phuoc123"
,
authentication:
"plain"
,
enable_starttls_auto:
true
}
...
...
config/environments/production.rb
View file @
9738679a
Rails
.
application
.
configure
do
# Settings specified here will take precedence over those in config/application.rb.
# config.action_mailer.default_options = { from: 'phuoc2811006@gmail.com' }
# config.action_mailer.default_url_options = { host: "localhost:3000" }
# config.action_mailer.raise_delivery_errors = true
# config.action_mailer.perform_deliveries = true
# config.action_mailer.delivery_method = :smtp
# config.action_mailer.smtp_settings = {
# address: "smtp.gmail.com",
# port: 587,
# domain: "localhost:3000",
# user_name: "phuoc2811006@gmail.com",
# password: "Phuoc123",
# authentication: "plain",
# enable_starttls_auto: true
# }
# Code is not reloaded between requests.
config
.
cache_classes
=
true
...
...
config/environments/test.rb
View file @
9738679a
Rails
.
application
.
configure
do
# Settings specified here will take precedence over those in config/application.rb.
# config.action_mailer.default_options = { from: 'phuoc2811006@gmail.com' }
# The test environment is used exclusively to run your application's
# test suite. You never need to work with it otherwise. Remember that
# your test database is "scratch space" for the test suite and is wiped
...
...
config/local_env.yml
→
config/local_env.yml
.gitignore
View file @
9738679a
...
...
@@ -6,6 +6,6 @@
# For example, setting:
# GMAIL_USERNAME: 'Your_Gmail_Username'
# makes 'Your_Gmail_Username' available as ENV["GMAIL_USERNAME"]
GMAIL_USERNAME
:
'
phuocht@zigexn.vn'
GMAIL_PASSWORD
:
'
Thienphuoc
123'
# PASSWORD_TPM: '
vjkjlbgoxqxvnbac
'
#
GMAIL_USERNAME: 'phuocht@zigexn.vn'
# GMAIL_PASSWORD: 'Thienphuoc0
123'
# PASSWORD_TPM: '
xaxxfxobotthglsm
'
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment