Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HCX-25 Fix MailSender class methods return values #19

Merged
merged 3 commits into from
Feb 5, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ v1.4.1 [unreleased]
- [#12](https://github.com/latera/camunda-ext/pull/12) Fix helpers.Hydra#parseRegion method
- [#207b8cc](https://github.com/latera/camunda-ext/commit/207b8cc) Fix exception while getting constant with spaces in code
- [#7a30801](https://github.com/latera/camunda-ext/commit/7a30801) Fix names of methods getConstantByCode and getConstantCode
- [#19](https://github.com/latera/camunda-ext/pull/19) Fix MailSender class methods return values

v1.4 [2020-01-13]
-------------------
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ class MailSender {
return this
}

MailSender getHost() {
String getHost() {
return this.host
}

Expand All @@ -103,7 +103,7 @@ class MailSender {
return this
}

MailSender getPort() {
Integer getPort() {
return this.port
}

Expand All @@ -117,7 +117,7 @@ class MailSender {
return setPort(port.toInteger())
}

MailSender getUser() {
String getUser() {
return this.user
}

Expand Down Expand Up @@ -162,10 +162,10 @@ class MailSender {
return this
}

MailSender addFile(CharSequence filename, Object datasource){
MailSender addFile(CharSequence name, Object datasource) {
MimeBodyPart part = new MimeBodyPart()
part.setDataHandler(new DataHandler(datasource, 'application/octet-stream'))
part.setFileName(filename.toString())
part.setFileName(MimeUtility.encodeText(name, 'UTF-8', null))
this.multipart.addBodyPart(part)
return this
}
Expand All @@ -179,14 +179,19 @@ class MailSender {
return this
}

void send(){
Boolean send() {
Boolean result = true
connect()
try {
this.message.setContent(this.multipart)
this.transport.sendMessage(this.message, this.message.getAllRecipients())
}
finally {
} catch (Exception e) {
logger.error(e)
result = false
} finally {
transport.close()
}

return result
}
}