Skip to content

Commit

Permalink
Merge pull request #2 from choonchernlim/feature/0.1.3
Browse files Browse the repository at this point in the history
0.1.3
  • Loading branch information
choonchernlim authored Nov 20, 2018
2 parents 95c6c78 + 8ad5ce6 commit f0f87dd
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 5 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Change Log

## 0.1.3 - 2018-11-20

* REFACTOR - `MailService.getText(..)` - Changed modifier from `private` to `public`.

## 0.1.2 - 2018-08-15

* FEATURE - Added `Method` value in exception email report.
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ This will be the last email service I will ever write in my whole lifetime.
<dependency>
<groupId>com.github.choonchernlim</groupId>
<artifactId>spring-boot-mail</artifactId>
<version>0.1.2</version>
<version>0.1.3</version>
</dependency>
```

Expand Down
4 changes: 2 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@
<parent>
<groupId>com.github.choonchernlim</groupId>
<artifactId>spring-boot-ci</artifactId>
<version>0.3.1</version>
<version>0.3.2</version>
<relativePath/>
</parent>

<groupId>com.github.choonchernlim</groupId>
<artifactId>spring-boot-mail</artifactId>
<version>0.1.2</version>
<version>0.1.3</version>

<dependencyManagement>
<dependencies>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,10 @@ class MailService {
* @param isHtmlText Whether it is HTML or plain text
* @return Email message
*/
private String getText(Exception exception, HttpServletRequest request, String userText, boolean isHtmlText) {
String getText(final Exception exception,
final HttpServletRequest request,
final String userText,
final boolean isHtmlText) {
if (!exception) {
return userText
}
Expand All @@ -151,7 +154,10 @@ class MailService {
final Map<String, Object> requestMap = request ? dataExtractorService.getRequestMap(request) : [:]

final Map<String, Object> dataMap = (generalInfoMap + requestMap + exceptionMap).asImmutable()
final String generatedText = textOutputService.getText(dataMap, isHtmlText)

return userText + '\n\n' + textOutputService.getText(dataMap, isHtmlText)
return userText?.trim() ?
userText + '\n\n' + generatedText :
generatedText
}
}

0 comments on commit f0f87dd

Please sign in to comment.