mailto 0.1.0 → 0.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e1489b60f5885ab72863231dd4e0c287fb5651945b96bcd11d63d9a2261ed664
4
- data.tar.gz: 6f4d3e2a53dd2b7b2c9df3ef5c7147800b6b0a4d9941a82d944b08518fe0bdf3
3
+ metadata.gz: 63293cec5c543760e0860d3588dd3d3dd8ea627c6dac5363dda398528d8f6d90
4
+ data.tar.gz: 452a3276322e8eb7533105ac490013b5acd74145590b6837af38286a6a4e84d5
5
5
  SHA512:
6
- metadata.gz: ef31fb17f622a5446d0661f94fa82c60f25bcd71b4d2977e1c7a2d64fcc5fe1a722f45ebd58381ea8bf7d4487338edfc5b1d9ee46895d497df16fbbe9ade7679
7
- data.tar.gz: 60ef731a84b88f3aefa1008bf93b658642188471a9c64739cbaa2142afb860b175cc873d6eace7131228a0dd9148946017c83dfd7a638ae259040ef82ea405e5
6
+ metadata.gz: e6247ef80d69317d9eec78edcc1d4e920c99cdfe4619623b6176f3027ffda6e2e8c24c0473d6e7608435b4d176ff0783711d349cda93c8ec100acd582e6330dc
7
+ data.tar.gz: 5f53699c84bbf6df1bec5780dc7aeb90351c068f976db6edaa4f3cf8d4901c722b26ea3c9d475750162d2a7b7e66f687b5feb01a769f5c64cb7e2c21a21d4731
data/README.md CHANGED
@@ -20,7 +20,7 @@ This creates the `./app/mailtos` directory and populates it with a few example t
20
20
 
21
21
  ## Usage
22
22
 
23
- Create a mailto template in the `app/mailtos` folder that looks like this:
23
+ Create a mailto template in the `app/mailtos/support.txt.erb` folder that looks like this:
24
24
 
25
25
  ```txt
26
26
  ---
@@ -37,7 +37,7 @@ Here's my browser information: <%= request.user_agent %>
37
37
  Cheers!
38
38
  ```
39
39
 
40
- Then load the `mail_to_template` view helper from any of your views:
40
+ Then load the `mail_to_template :support, "send us an email"` view helper from any of your views:
41
41
 
42
42
  ```
43
43
  <h1>Get help!</h1>
@@ -1,10 +1,10 @@
1
1
  # Make it a little easier to integrate email into support flows, etc.
2
2
  module MailtoHelper
3
- def mail_to_template(template, text, **kwargs)
3
+ def mail_to_template(template, text, **kwargs, &block)
4
4
  contents = File.read Rails.root.join("app/mailtos/#{template}.txt.erb")
5
5
  parser = Mailto::Frontmatter.new render inline: contents
6
6
  data = parser.data.merge("body": parser.body)
7
7
  email = data.delete("to")
8
- mail_to email, text, **data.merge(kwargs)
8
+ mail_to email, text, **data.merge(kwargs), &block
9
9
  end
10
10
  end
@@ -1,8 +1,8 @@
1
1
  Description:
2
- Explain the generator
2
+ Installs mailto gem and creates ./app/mailtos/support.txt.erb example template.
3
3
 
4
4
  Example:
5
- bin/rails generate install Thing
5
+ bin/rails generate mailto:install
6
6
 
7
7
  This will create:
8
- what/will/it/create
8
+ app/mailtos/*.txt.erb
@@ -1,4 +1,4 @@
1
- class Mailto::InstallGenerator < Rails::Generators::NamedBase
1
+ class Mailto::InstallGenerator < Rails::Generators::Base
2
2
  source_root File.expand_path("templates", __dir__)
3
3
 
4
4
  def copy_templates
@@ -1,3 +1,3 @@
1
1
  module Mailto
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.2"
3
3
  end
metadata CHANGED
@@ -1,14 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mailto
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brad Gessler
8
- autorequire:
9
8
  bindir: bin
10
9
  cert_chain: []
11
- date: 2022-07-01 00:00:00.000000000 Z
10
+ date: 2025-02-12 00:00:00.000000000 Z
12
11
  dependencies:
13
12
  - !ruby/object:Gem::Dependency
14
13
  name: rails
@@ -16,14 +15,14 @@ dependencies:
16
15
  requirements:
17
16
  - - ">="
18
17
  - !ruby/object:Gem::Version
19
- version: 7.0.3
18
+ version: 7.1.0
20
19
  type: :runtime
21
20
  prerelease: false
22
21
  version_requirements: !ruby/object:Gem::Requirement
23
22
  requirements:
24
23
  - - ">="
25
24
  - !ruby/object:Gem::Version
26
- version: 7.0.3
25
+ version: 7.1.0
27
26
  description: Use email for customer communications.
28
27
  email:
29
28
  - bradgessler@gmail.com
@@ -52,7 +51,6 @@ metadata:
52
51
  homepage_uri: https://github.com/rocketshipio/mailto
53
52
  source_code_uri: https://github.com/rocketshipio/mailto
54
53
  changelog_uri: https://github.com/rocketshipio/mailto
55
- post_install_message:
56
54
  rdoc_options: []
57
55
  require_paths:
58
56
  - lib
@@ -67,8 +65,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
67
65
  - !ruby/object:Gem::Version
68
66
  version: '0'
69
67
  requirements: []
70
- rubygems_version: 3.3.15
71
- signing_key:
68
+ rubygems_version: 3.6.2
72
69
  specification_version: 4
73
70
  summary: Use email for customer communications.
74
71
  test_files: []