fastlane-plugin-gmail 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/LICENSE +21 -0
- data/README.md +69 -0
- data/lib/fastlane/plugin/gmail.rb +16 -0
- data/lib/fastlane/plugin/gmail/actions/gmail_action.rb +109 -0
- data/lib/fastlane/plugin/gmail/version.rb +5 -0
- metadata +160 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 5b45263fc00beb529ddb2a28d0799b88dceb0edd61db5e588f61cc0d2621f39f
|
4
|
+
data.tar.gz: d892d1d16e6de211c31f41477cd8e1f1ae1cc4ca750582532b5083281d115d55
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 6cf793e21f01f4f9ae0ab8b37e68b861abffdd19a8c1a958710053c2bc79370f67ec26c587873be1731f39ac08973053aba56cb58ff9aa7a731a7f8bfc451941
|
7
|
+
data.tar.gz: 1ab2560f6e6642afea92407427722d5b0e9d67ba7f67814da9a834689877bfa679d8d83d2c72ef41426fdcb7547a693376f711823e88df33ca1cb817f59d3378
|
data/LICENSE
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
The MIT License (MIT)
|
2
|
+
|
3
|
+
Copyright (c) 2017 Alexander Ignition <izh.sever@gmail.com>
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
13
|
+
copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
21
|
+
SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,69 @@
|
|
1
|
+
# gmail plugin
|
2
|
+
|
3
|
+
[![fastlane Plugin Badge](https://rawcdn.githack.com/fastlane/fastlane/master/fastlane/assets/plugin-badge.svg)](https://rubygems.org/gems/fastlane-plugin-gmail)
|
4
|
+
|
5
|
+
## Getting Started
|
6
|
+
|
7
|
+
This project is a [_fastlane_](https://github.com/fastlane/fastlane) plugin. To get started with `fastlane-plugin-gmail`, add it to your project by running:
|
8
|
+
|
9
|
+
```bash
|
10
|
+
fastlane add_plugin gmail
|
11
|
+
```
|
12
|
+
|
13
|
+
## About gmail
|
14
|
+
|
15
|
+
Send mail from gmail.
|
16
|
+
|
17
|
+
Authentication options:
|
18
|
+
- Username and password - specify options RMR_GMAIL_USERNAME and RMR_GMAIL_PASSWORD.<br>
|
19
|
+
[G Suite](https://support.google.com/a/answer/176600?hl=en) documentation, see Gmail SMTP server.
|
20
|
+
> if you use two-factor authentication, create a password for the application. [Sign in using App Passwords](https://support.google.com/accounts/answer/185833?hl=en)
|
21
|
+
|
22
|
+
- Auth by IP for G Suite accounts. You should configure your G Suite account and specify option RMR_GMAIL_DOMAIN.<br>
|
23
|
+
See documentation [SMTP relay](https://support.google.com/a/answer/2956491?hl=en).
|
24
|
+
|
25
|
+
|
26
|
+
## Options
|
27
|
+
|
28
|
+
| Key | Description | Env Var | Default |
|
29
|
+
|----------|--------------------------|-------------------|-----------|
|
30
|
+
| domain | G Suite domain | FL_GMAIL_DOMAIN | gmail.com |
|
31
|
+
| username | Username for gmail | FL_GMAIL_USERNAME | |
|
32
|
+
| password | Password for gmail | FL_GMAIL_PASSWORD | |
|
33
|
+
| to | Mail to recipients | FL_GMAIL_TO | |
|
34
|
+
| subject | The subject of the email | Fl_GMAIL_SUBJECT | |
|
35
|
+
| body | The body of the email | Fl_GMAIL_BODY | |
|
36
|
+
|
37
|
+
|
38
|
+
## Example
|
39
|
+
|
40
|
+
Check out the [example `Fastfile`](fastlane/Fastfile) to see how to use this plugin. Try it by cloning the repo, running `fastlane install_plugins` and `bundle exec fastlane test`.
|
41
|
+
|
42
|
+
## Run tests for this plugin
|
43
|
+
|
44
|
+
To run both the tests, and code style validation, run
|
45
|
+
|
46
|
+
```
|
47
|
+
rake
|
48
|
+
```
|
49
|
+
|
50
|
+
To automatically fix many of the styling issues, use
|
51
|
+
```
|
52
|
+
rubocop -a
|
53
|
+
```
|
54
|
+
|
55
|
+
## Issues and Feedback
|
56
|
+
|
57
|
+
For any other issues and feedback about this plugin, please submit it to this repository.
|
58
|
+
|
59
|
+
## Troubleshooting
|
60
|
+
|
61
|
+
If you have trouble using plugins, check out the [Plugins Troubleshooting](https://docs.fastlane.tools/plugins/plugins-troubleshooting/) guide.
|
62
|
+
|
63
|
+
## Using _fastlane_ Plugins
|
64
|
+
|
65
|
+
For more information about how the `fastlane` plugin system works, check out the [Plugins documentation](https://docs.fastlane.tools/plugins/create-plugin/).
|
66
|
+
|
67
|
+
## About _fastlane_
|
68
|
+
|
69
|
+
_fastlane_ is the easiest way to automate beta deployments and releases for your iOS and Android apps. To learn more, check out [fastlane.tools](https://fastlane.tools).
|
@@ -0,0 +1,16 @@
|
|
1
|
+
require 'fastlane/plugin/gmail/version'
|
2
|
+
|
3
|
+
module Fastlane
|
4
|
+
module Gmail
|
5
|
+
# Return all .rb files inside the "actions" and "helper" directory
|
6
|
+
def self.all_classes
|
7
|
+
Dir[File.expand_path('**/{actions,helper}/*.rb', File.dirname(__FILE__))]
|
8
|
+
end
|
9
|
+
end
|
10
|
+
end
|
11
|
+
|
12
|
+
# By default we want to import all available actions and helpers
|
13
|
+
# A plugin can contain any number of actions and plugins
|
14
|
+
Fastlane::Gmail.all_classes.each do |current|
|
15
|
+
require current
|
16
|
+
end
|
@@ -0,0 +1,109 @@
|
|
1
|
+
module Fastlane
|
2
|
+
module Actions
|
3
|
+
class GmailAction < Action
|
4
|
+
def self.run(params)
|
5
|
+
require 'mail'
|
6
|
+
|
7
|
+
Mail.defaults do
|
8
|
+
if params[:password]
|
9
|
+
delivery_method :smtp, {
|
10
|
+
address: 'smtp.gmail.com',
|
11
|
+
port: 587,
|
12
|
+
user_name: params[:username],
|
13
|
+
password: params[:password],
|
14
|
+
authentication: 'plain',
|
15
|
+
enable_starttls_auto: true
|
16
|
+
}
|
17
|
+
else
|
18
|
+
delivery_method :smtp, {
|
19
|
+
port: 587,
|
20
|
+
address: "smtp-relay.gmail.com",
|
21
|
+
domain: params[:domain]
|
22
|
+
}
|
23
|
+
end
|
24
|
+
end
|
25
|
+
|
26
|
+
Mail.deliver do
|
27
|
+
from params[:username]
|
28
|
+
to params[:to]
|
29
|
+
subject params[:subject]
|
30
|
+
html_part do
|
31
|
+
content_type 'text/html; charset=UTF-8'
|
32
|
+
body params[:body]
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
36
|
+
|
37
|
+
#####################################################
|
38
|
+
# @!group Documentation
|
39
|
+
#####################################################
|
40
|
+
|
41
|
+
def self.description
|
42
|
+
"A short description with <= 80 characters of what this action does"
|
43
|
+
end
|
44
|
+
|
45
|
+
def self.details
|
46
|
+
# Optional:
|
47
|
+
# this is your chance to provide a more detailed description of this action
|
48
|
+
"You can use this action to do cool things..."
|
49
|
+
end
|
50
|
+
|
51
|
+
def self.available_options
|
52
|
+
[
|
53
|
+
FastlaneCore::ConfigItem.new(key: :domain,
|
54
|
+
env_name: "FL_GMAIL_DOMAIN",
|
55
|
+
description: "G Suite domain",
|
56
|
+
optional: true,
|
57
|
+
default_value: "gmail.com",
|
58
|
+
verify_block: proc do |value|
|
59
|
+
UI.user_error!("No domain") if value.to_s.length == 0
|
60
|
+
end),
|
61
|
+
FastlaneCore::ConfigItem.new(key: :username,
|
62
|
+
env_name: "FL_GMAIL_USERNAME",
|
63
|
+
description: "Username for gmail",
|
64
|
+
verify_block: proc do |value|
|
65
|
+
UI.user_error!("No username") if value.to_s.length == 0
|
66
|
+
end),
|
67
|
+
FastlaneCore::ConfigItem.new(key: :password,
|
68
|
+
env_name: "FL_GMAIL_PASSWORD",
|
69
|
+
description: "Password for gmail",
|
70
|
+
optional: true,
|
71
|
+
sensitive: true,
|
72
|
+
verify_block: proc do |value|
|
73
|
+
UI.user_error!("No password") if value.to_s.length == 0
|
74
|
+
end),
|
75
|
+
FastlaneCore::ConfigItem.new(key: :to,
|
76
|
+
env_name: "FL_GMAIL_TO",
|
77
|
+
description: "Mail to recipients",
|
78
|
+
sensitive: true,
|
79
|
+
is_string: false,
|
80
|
+
verify_block: proc do |value|
|
81
|
+
UI.user_error!("No recipients") if value.to_s.length == 0
|
82
|
+
end),
|
83
|
+
FastlaneCore::ConfigItem.new(key: :subject,
|
84
|
+
env_name: "FL_GMAIL_SUBJECT",
|
85
|
+
description: "The subject of the email",
|
86
|
+
sensitive: true,
|
87
|
+
verify_block: proc do |value|
|
88
|
+
UI.user_error!("No subject of email") if value.to_s.length == 0
|
89
|
+
end),
|
90
|
+
FastlaneCore::ConfigItem.new(key: :body,
|
91
|
+
env_name: "FL_GMAIL_BODY",
|
92
|
+
description: "The body of the email",
|
93
|
+
sensitive: true,
|
94
|
+
verify_block: proc do |value|
|
95
|
+
UI.user_error!("No body of email") if value.to_s.length == 0
|
96
|
+
end)
|
97
|
+
]
|
98
|
+
end
|
99
|
+
|
100
|
+
def self.authors
|
101
|
+
["Alexander-Ignition"]
|
102
|
+
end
|
103
|
+
|
104
|
+
def self.is_supported?(platform)
|
105
|
+
true
|
106
|
+
end
|
107
|
+
end
|
108
|
+
end
|
109
|
+
end
|
metadata
ADDED
@@ -0,0 +1,160 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: fastlane-plugin-gmail
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.1
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Alexander Ignition
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2018-12-11 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: mail
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: 2.6.5
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: 2.6.5
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: pry
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ">="
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '0'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - ">="
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: bundler
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - ">="
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '0'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - ">="
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: rspec
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - ">="
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - ">="
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '0'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: rake
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - ">="
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '0'
|
76
|
+
type: :development
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - ">="
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '0'
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: rubocop
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - ">="
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: 0.49.1
|
90
|
+
type: :development
|
91
|
+
prerelease: false
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - ">="
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: 0.49.1
|
97
|
+
- !ruby/object:Gem::Dependency
|
98
|
+
name: simplecov
|
99
|
+
requirement: !ruby/object:Gem::Requirement
|
100
|
+
requirements:
|
101
|
+
- - ">="
|
102
|
+
- !ruby/object:Gem::Version
|
103
|
+
version: '0'
|
104
|
+
type: :development
|
105
|
+
prerelease: false
|
106
|
+
version_requirements: !ruby/object:Gem::Requirement
|
107
|
+
requirements:
|
108
|
+
- - ">="
|
109
|
+
- !ruby/object:Gem::Version
|
110
|
+
version: '0'
|
111
|
+
- !ruby/object:Gem::Dependency
|
112
|
+
name: fastlane
|
113
|
+
requirement: !ruby/object:Gem::Requirement
|
114
|
+
requirements:
|
115
|
+
- - ">="
|
116
|
+
- !ruby/object:Gem::Version
|
117
|
+
version: 2.50.0
|
118
|
+
type: :development
|
119
|
+
prerelease: false
|
120
|
+
version_requirements: !ruby/object:Gem::Requirement
|
121
|
+
requirements:
|
122
|
+
- - ">="
|
123
|
+
- !ruby/object:Gem::Version
|
124
|
+
version: 2.50.0
|
125
|
+
description:
|
126
|
+
email: izh.sever@gmail.com
|
127
|
+
executables: []
|
128
|
+
extensions: []
|
129
|
+
extra_rdoc_files: []
|
130
|
+
files:
|
131
|
+
- LICENSE
|
132
|
+
- README.md
|
133
|
+
- lib/fastlane/plugin/gmail.rb
|
134
|
+
- lib/fastlane/plugin/gmail/actions/gmail_action.rb
|
135
|
+
- lib/fastlane/plugin/gmail/version.rb
|
136
|
+
homepage:
|
137
|
+
licenses:
|
138
|
+
- MIT
|
139
|
+
metadata: {}
|
140
|
+
post_install_message:
|
141
|
+
rdoc_options: []
|
142
|
+
require_paths:
|
143
|
+
- lib
|
144
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
145
|
+
requirements:
|
146
|
+
- - ">="
|
147
|
+
- !ruby/object:Gem::Version
|
148
|
+
version: '0'
|
149
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
150
|
+
requirements:
|
151
|
+
- - ">="
|
152
|
+
- !ruby/object:Gem::Version
|
153
|
+
version: '0'
|
154
|
+
requirements: []
|
155
|
+
rubyforge_project:
|
156
|
+
rubygems_version: 2.7.7
|
157
|
+
signing_key:
|
158
|
+
specification_version: 4
|
159
|
+
summary: send mail from gmail
|
160
|
+
test_files: []
|