fastlane-plugin-send_e_mail 0.1.3 → 0.1.4

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
  SHA1:
3
- metadata.gz: e68971472784f75b198c3bb1c7e8a384b9f49bf5
4
- data.tar.gz: 6160295536e043fc6e3a8febec70b9fe63ade185
3
+ metadata.gz: 032b32b0516bc59c09990ac1e3b2e7b72f15978b
4
+ data.tar.gz: 0b047d1bff5e6c1eddc5486112b737fe77a546b1
5
5
  SHA512:
6
- metadata.gz: c71fccafcb16a55c21f2e147b215bf222a3dbe2556299510463bb176d5597759a2538570ada30f8d2cb7332e1aa6e4675d2591a6230f97744f472b715abe214d
7
- data.tar.gz: 7c7ff6ca7e32ae0487e6d604d92e765685df1756b713020681665eec1608ced48ce6acd3c03d893304b402da307f347aea6b9a095e4e2daa1899b43052af9fcd
6
+ metadata.gz: b9507e77e6c2a6490dd003ee56ec9143acd2df333b26985beb73750222c1c31ba4f2bf66bd943072b75d4266b12ce47d7458cb91d276e3dd2274e5a322e78224
7
+ data.tar.gz: 0b07164c5a2bcc22f7c23a96cf882c8221b00654cdd9af18391510cd4d2286f0f3e9d994b0e03c95f0997e8b25d153dac19ef131ea2f3b85d460e6e6282bbe79
data/README.md CHANGED
@@ -12,16 +12,12 @@ fastlane add_plugin send_e_mail
12
12
 
13
13
  ## About send_e_mail
14
14
 
15
- a tool to sendmail by stmp
16
-
17
- **Note to author:** Add a more detailed description about this plugin here. If your plugin contains multiple actions, make sure to mention them here.
15
+ just a tool to sendmail by stmp
18
16
 
19
17
  ## Example
20
18
 
21
19
  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`.
22
20
 
23
- **Note to author:** Please set up a sample project to make it easy for users to explore what your plugin does. Provide everything that is necessary to try out the plugin in this project (including a sample Xcode/Android project if necessary)
24
-
25
21
  ## Run tests for this plugin
26
22
 
27
23
  To run both the tests, and code style validation, run
@@ -7,30 +7,38 @@ require 'net/smtp'
7
7
  module Fastlane
8
8
  module Actions
9
9
  class SendEMailAction < Action
10
- def self.send_emails(stmpserver_address, sender_address, password, recipients, subject, message_body)
10
+ def self.send_emails(stmpserver_address, sender_address, password, recipients, subject, message_body, attachment, target)
11
11
  recipients.each do |recipient_address|
12
12
  message_header = ''
13
13
  message_header << "From: <#{sender_address}>\r\n"
14
14
  message_header << "To: <#{recipient_address}>\r\n"
15
15
  message_header << "Subject: #{subject}\r\n"
16
16
  message_header << "Date: " + Time.now.to_s + "\r\n"
17
- message = message_header + "\r\n" + message_body + "\r\n"
18
- Net::SMTP.start(stmpserver_address, 25, "localhost", sender_address, password, :plain) do |smtp|
19
- # begin
20
- smtp.send_message(message, sender_address, recipient_address)
21
- # rescue
22
- # raise FileSaveError, $!
23
- # end
17
+ message_header << "MIME-Version: 1.0" + "\r\n"
18
+ message_header << "Content-type: text/html;charset=utf-8" + "\r\n"
19
+ message = message_header + "\r\n" + message_body.encode('utf-8') + "\r\n"
20
+ Net::SMTP.start(stmpserver_address, 25, "yeah.net", sender_address, password, :plain) do |smtp|
21
+ begin
22
+ smtp.send_message(message, sender_address, recipient_address)
23
+ rescue
24
+ raise Exception => e
25
+ print "Exception occured: " + e
26
+ end
24
27
  end
25
28
 
26
29
  end
27
30
  end
28
31
 
29
32
  def self.run(params)
30
- # @params = params
31
- # UI.message("The send_e_mail plugin is working!")
32
- # self.send_emails(params[:stmpServer], params[:userName], params[:password], @params[:recipients], params[:subject], params[:message_body])
33
- self.send_emails(params[:stmp_server], params[:user_name], params[:password], params[:recipients], params[:subject], params[:message_body])
33
+ self.send_emails(
34
+ params[:stmp_server],
35
+ params[:user_name],
36
+ params[:password],
37
+ params[:recipients],
38
+ params[:subject],
39
+ params[:message_body],
40
+ params[:attachment],
41
+ params[:target])
34
42
  end
35
43
 
36
44
  def self.description
@@ -85,6 +93,11 @@ module Fastlane
85
93
  type: String),
86
94
  FastlaneCore::ConfigItem.new(key: :attachment,
87
95
  env_name: "SEND_E_MAIL_attachment",
96
+ description: "A description of attachment",
97
+ optional: true,
98
+ type: String),
99
+ FastlaneCore::ConfigItem.new(key: :target,
100
+ env_name: "SEND_E_MAIL_attachment",
88
101
  description: "A description of attachment",
89
102
  optional: true,
90
103
  type: String)
@@ -1,5 +1,5 @@
1
1
  module Fastlane
2
2
  module SendEMail
3
- VERSION = "0.1.3"
3
+ VERSION = "0.1.4"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fastlane-plugin-send_e_mail
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - huangj
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-08-09 00:00:00.000000000 Z
11
+ date: 2018-08-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: pry