Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
V
venshop
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
Tan Phat Nguyen
venshop
Commits
fc504b30
Commit
fc504b30
authored
Nov 18, 2014
by
Tan Phat Nguyen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Order mailer buider, css image , title
parent
d5e3c08a
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
38 additions
and
31 deletions
+38
-31
app/assets/stylesheets/custom_bootstrap.css.scss
+8
-0
app/controllers/orders_controller.rb
+1
-1
app/mailers/mail_order.rb
+3
-4
app/views/mail_order/confirm.html.erb
+2
-1
app/views/mail_order/confirm.text.erb
+3
-0
app/views/notifier/order_received.text.erb
+0
-7
app/views/products/_product.html.erb
+2
-1
config/environments/development.rb
+2
-2
lib/tasks/db.rake
+3
-3
test/mailers/mail_order_test.rb
+5
-4
test/mailers/previews/mail_order_preview.rb
+9
-0
test/mailers/previews/notifier_preview.rb
+0
-8
No files found.
app/assets/stylesheets/custom_bootstrap.css.scss
View file @
fc504b30
...
...
@@ -109,4 +109,11 @@ h2 {
.alert-notice
{
@extend
.alert-success
;
}
.prod-title
{
//height: 40px;
white-space
:
nowrap
;
overflow
:
hidden
;
text-overflow
:
ellipsis
;
}
\ No newline at end of file
app/controllers/orders_controller.rb
View file @
fc504b30
...
...
@@ -25,7 +25,7 @@ class OrdersController < ApplicationController
if
@order
.
save
current_cart
.
destroy
session
[
:cart_id
]
=
nil
Notifier
.
order_received
(
@order
).
deliver
MailOrder
.
confirm
(
@order
).
deliver
flash
[
:success
]
=
'Successfully. Thank you for your order.'
redirect_to
root_path
else
...
...
app/mailers/
notifi
er.rb
→
app/mailers/
mail_ord
er.rb
View file @
fc504b30
class
Notifi
er
<
ActionMailer
::
Base
class
MailOrd
er
<
ActionMailer
::
Base
default
from:
'bigforest20@gmail.com'
def
order_received
(
order
)
def
confirm
(
order
)
@order
=
order
mail
to:
order
.
email
,
subject:
'Venshop Store Order Confirmation'
end
end
\ No newline at end of file
end
app/views/
notifier/order_received
.html.erb
→
app/views/
mail_order/confirm
.html.erb
View file @
fc504b30
...
...
@@ -18,4 +18,4 @@
</tr>
</table>
<br/>
<div>
We'll send you a separate e-mail when your order ships.
</div>
<div>
We'll send you a separate e-mail when your order ships.
</div>
\ No newline at end of file
app/views/mail_order/confirm.text.erb
0 → 100644
View file @
fc504b30
MailOrder#confirm
<%=
@greeting
%>
, find me in app/views/mail_order/confirm.text.erb
app/views/notifier/order_received.text.erb
deleted
100644 → 0
View file @
d5e3c08a
Dear
<%=
@order
.
name
%>
Thank you for your recent order from The Venshop Store.
You ordered the following items:
We'll send you a separate e-mail when your order ships.
app/views/products/_product.html.erb
View file @
fc504b30
...
...
@@ -2,7 +2,7 @@
<div
style=
'height: 234px;'
>
<%=
image_tag
product
.
photo_url
.
to_s
,
width:
'140'
,
height:
'140'
,
class:
'img-thumbnail'
%>
</div>
<
h4>
<%=
link_to
product
.
name
,
product_path
(
product
)
%>
</h4
>
<
div
class=
'prod-title'
><h4>
<%=
link_to
product
.
name
,
product_path
(
product
)
%>
</h4></div
>
<span
class=
'price-col'
>
$
<%=
product
.
price
%>
</span>
<%=
button_to
'Add to Cart'
,
line_items_path
(
product_id:
product
),
{
class:
'btn btn-default'
}
%>
</div>
\ No newline at end of file
config/environments/development.rb
View file @
fc504b30
...
...
@@ -22,8 +22,8 @@ Rails.application.configure do
port:
587
,
domain:
'gmail.com'
,
authentication:
'plain'
,
user_name:
ENV
[
'
pusher_
email_user'
],
password:
ENV
[
'
pusher_
email_password'
],
user_name:
ENV
[
'email_user'
],
password:
ENV
[
'email_password'
],
enable_starttls_auto:
true
}
...
...
lib/tasks/db.rake
View file @
fc504b30
...
...
@@ -73,9 +73,9 @@ namespace :db do
def
build_request
@request
=
Vacuum
.
new
@request
.
configure
(
aws_access_key_id:
ENV
[
'
pusher_
aws_access_key_id'
],
aws_secret_access_key:
ENV
[
'
pusher_
aws_secret_access_key'
],
associate_tag:
ENV
[
'
pusher_
associate_tag'
]
aws_access_key_id:
ENV
[
'aws_access_key_id'
],
aws_secret_access_key:
ENV
[
'aws_secret_access_key'
],
associate_tag:
ENV
[
'associate_tag'
]
)
end
...
...
test/mailers/
notifi
er_test.rb
→
test/mailers/
mail_ord
er_test.rb
View file @
fc504b30
require
'test_helper'
class
Notifi
erTest
<
ActionMailer
::
TestCase
test
"
order_received
"
do
mail
=
Notifier
.
order_received
assert_equal
"
Order received
"
,
mail
.
subject
class
MailOrd
erTest
<
ActionMailer
::
TestCase
test
"
confirm
"
do
mail
=
MailOrder
.
confirm
assert_equal
"
Confirm
"
,
mail
.
subject
assert_equal
[
"to@example.org"
],
mail
.
to
assert_equal
[
"from@example.com"
],
mail
.
from
assert_match
"Hi"
,
mail
.
body
.
encoded
end
end
test/mailers/previews/mail_order_preview.rb
0 → 100644
View file @
fc504b30
# Preview all emails at http://localhost:3000/rails/mailers/mail_order
class
MailOrderPreview
<
ActionMailer
::
Preview
# Preview this email at http://localhost:3000/rails/mailers/mail_order/confirm
def
confirm
MailOrder
.
confirm
end
end
test/mailers/previews/notifier_preview.rb
deleted
100644 → 0
View file @
d5e3c08a
# Preview all emails at http://localhost:3000/rails/mailers/notifier
class
NotifierPreview
<
ActionMailer
::
Preview
# Preview this email at http://localhost:3000/rails/mailers/notifier/order_received
def
order_received
Notifier
.
order_received
end
end
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