credible 0.2.1 → 0.3.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: af0ef8a69bffbd53bfaf823fc29a107cb6e8ae2d8da42b7463367c6cf0443c3e
4
- data.tar.gz: 2fa77fbeaa822062e66fd2fcfa4eeef4046dc27f16c620389a2a38cd6c156b20
3
+ metadata.gz: 2a7e831e22ec5681ca50fa757a380c8bfacca2110ea5198a8b1a1ad756bedef9
4
+ data.tar.gz: ec273ca2a4984cc04fcce5a9a335b034258d927c22e7f6c8afecf86ec56d53b6
5
5
  SHA512:
6
- metadata.gz: bbbe6d188e62a58ea4029a209a4f63d0987f359f3370b50657c710887e3708cd6fc04e5213073bd689a2a63af5a1ffc0b6ef1dbea94dfd186e6023f4a98755e3
7
- data.tar.gz: 7aef0eb8eaf40fc6f5dd8f53213cb993452c67f27cee3de7ba01b25206e8252f92a6385365fa85826b0e843dc17e3937fe2cb87cbe8d0d1e7cebe13256e93ade
6
+ metadata.gz: 9c13e39deeedff85915708af06b2dc90b1db47a7f6b47b8d214fc318f958403342e7270ec20bdf73c52679f65478fec51a63ec774b6cc6454300066daa9d9ed9
7
+ data.tar.gz: 486785ac185da55edd463932d4b537cb7037901cad30e0842e0c43e1643cd6726e871be790daa8bb6ec62f5cf81ab717dccaade94150300717f03517b2900cf8
data/README.md CHANGED
@@ -70,6 +70,14 @@ class Session < ApplicationRecord
70
70
  end
71
71
  ```
72
72
 
73
+ ## Mailers
74
+
75
+ To user Credible's in-built mailers, you must set a hostname for your application. A suitable setting for this in `config/environments/development.rb` might be:
76
+
77
+ ```ruby
78
+ config.action_mailer.default_url_options = { host: 'localhost', port: 3000 }
79
+ ```
80
+
73
81
  ## Contributing
74
82
 
75
83
  Credible is not yet accepting contributions. Watch this space.
@@ -1,21 +1,18 @@
1
- class Credible::UserMailer < Credible::ApplicationMailer
2
- # TODO: Decouple from Settings in inheriting application.
3
- # QUESTION: How then will we set the URL?
4
-
1
+ class Credible::UserMailer < ApplicationMailer
5
2
  include Rails.application.routes.url_helpers
6
3
 
7
4
  def confirmation_email
8
- @settings = Settings.instance
5
+ @app_name = Rails.application.class.module_parent_name
9
6
  @user = params[:user]
10
- @url = root_url(host: @settings.hostname)
7
+ @url = root_url
11
8
  @confirmation_url = @url + 'confirm/' + @user.confirmation_token
12
- mail(from: @settings.email, to: @user.email, subject: "Welcome to #{Rails.application.class.module_parent_name} | Please confirm your account")
9
+ mail(to: @user.email, subject: "Welcome to #{@app_name} | Please confirm your account")
13
10
  end
14
11
 
15
12
  def invitation_email
16
- @settings = Settings.instance
13
+ @app_name = Rails.application.class.module_parent_name
17
14
  @user = params[:user]
18
- @url = root_url(host: @settings.hostname)
19
- mail(from: @settings.email, to: @user.email, subject: "You have been invited to #{Rails.application.class.module_parent_name}")
15
+ @url = root_url
16
+ mail(to: @user.email, subject: "You have been invited to #{@app_name}")
20
17
  end
21
18
  end
@@ -1,7 +1,7 @@
1
- %h1= "Welcome to #{@settings.name}, #{@user.name}"
1
+ %h1= "Welcome to #{@app_name}, #{@user.name}"
2
2
 
3
3
  %p
4
- = "You have successfully signed up to #{@settings.name}, your username is: #{@user.email}."
4
+ = "You have successfully signed up to #{@app_name}, your username is: #{@user.email}."
5
5
  %br/
6
6
 
7
7
  %p
@@ -1,7 +1,7 @@
1
- = "Welcome to #{@settings.name}, #{@user.name}"
1
+ = "Welcome to #{@app_name}, #{@user.name}"
2
2
  \===============================================
3
3
 
4
- = "You have successfully signed up to #{@settings.name}, your username is: #{@user.email}."
4
+ = "You have successfully signed up to #{@app_name}, your username is: #{@user.email}."
5
5
 
6
6
  To confirm your account, please follow this link:
7
7
  = @confirmation_url
@@ -1,3 +1,3 @@
1
- %h1= "You have been invited to #{@settings.name}"
1
+ %h1= "You have been invited to #{@app_name}"
2
2
  %p= "To login to the site, just follow this link: #{@url}."
3
3
  %p Thanks for joining and have a great day!
@@ -1,4 +1,4 @@
1
- = "You have been invited to #{@settings.name}"
1
+ = "You have been invited to #{@app_name}"
2
2
  \===============================================
3
3
 
4
4
  = "To login to the site, just follow this link: #{@url}."
@@ -1,3 +1,3 @@
1
1
  module Credible
2
- VERSION = '0.2.1'
2
+ VERSION = '0.3.0'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: credible
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Thom Bruce
@@ -100,7 +100,6 @@ files:
100
100
  - app/controllers/credible/authentication_controller.rb
101
101
  - app/helpers/credible/application_helper.rb
102
102
  - app/jobs/credible/application_job.rb
103
- - app/mailers/credible/application_mailer.rb
104
103
  - app/mailers/credible/user_mailer.rb
105
104
  - app/models/credible/application_record.rb
106
105
  - app/policies/credible/application_policy.rb
@@ -1,6 +0,0 @@
1
- module Credible
2
- class ApplicationMailer < ActionMailer::Base
3
- default from: 'from@example.com'
4
- layout 'mailer'
5
- end
6
- end