Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
mailingms
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
tgms
mailingms
Commits
b8317129
Commit
b8317129
authored
7 years ago
by
Andrew Safronov
Browse files
Options
Downloads
Patches
Plain Diff
Add work with letter atachment logic.
parent
1d65396d
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
Gopkg.lock
+2
-2
2 additions, 2 deletions
Gopkg.lock
mailer/mailer.go
+8
-0
8 additions, 0 deletions
mailer/mailer.go
mailer/mailer_handler.go
+2
-0
2 additions, 0 deletions
mailer/mailer_handler.go
with
12 additions
and
2 deletions
Gopkg.lock
+
2
−
2
View file @
b8317129
...
...
@@ -178,7 +178,7 @@
branch = "master"
name = "gitlab.qarea.org/tgms/authorizationlib"
packages = ["."]
revision = "
a3724d3a281fbdad53f188809dadeae0b752ef7c
"
revision = "
966127ad546a22239f07e143933ac17ea57c490f
"
[[projects]]
branch = "master"
...
...
@@ -190,7 +190,7 @@
branch = "master"
name = "gitlab.qarea.org/tgms/eventlib"
packages = ["."]
revision = "
b039e648b3aef06b67053e643d930879a34f8285
"
revision = "
53ef576641aa09758cafe3d2900136ae10cfd95a
"
[[projects]]
branch = "master"
...
...
This diff is collapsed.
Click to expand it.
mailer/mailer.go
+
8
−
0
View file @
b8317129
...
...
@@ -12,6 +12,7 @@ import (
"gitlab.qarea.org/tgms/eventlib"
"gitlab.qarea.org/tgms/mailingms/cfg"
"io"
)
var
log
=
narada
.
NewLog
(
"mailer: "
)
...
...
@@ -35,6 +36,13 @@ func NewLetter(request eventlib.SendEmailRequest) (*gomail.Message, error) {
body
:=
embedder
(
templ
,
templatePath
,
message
)
message
.
SetBody
(
"text/html"
,
body
)
if
request
.
AttachmentName
!=
""
{
message
.
Attach
(
request
.
AttachmentName
,
gomail
.
SetCopyFunc
(
func
(
w
io
.
Writer
)
error
{
_
,
err
:=
w
.
Write
(
request
.
Attachment
)
return
err
}))
}
return
message
,
nil
}
...
...
This diff is collapsed.
Click to expand it.
mailer/mailer_handler.go
+
2
−
0
View file @
b8317129
...
...
@@ -58,6 +58,8 @@ var invoiceSentHandler eventlib.OnInvoiceSent = func(event eventlib.Event, invoi
Subj
:
"Invoice created"
,
TemplateName
:
"invoice_sent"
,
Params
:
invoiceSentRequest
.
Params
,
Attachment
:
invoiceSentRequest
.
Attachment
,
AttachmentName
:
"invoice.pdf"
,
}
log
.
DEBUG
(
" :: %+v"
,
request
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment