Skip to content
This repository has been archived by the owner on Oct 3, 2024. It is now read-only.

New Crowdin updates #32

Open
wants to merge 10 commits into
base: main
Choose a base branch
from
11 changes: 11 additions & 0 deletions content/de/community/merch.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
title: Merchandising
---

Dank unserer wunderbaren Freunde von [HelloTux](https://www.hellotux.com)
können wir großartiges Go-Mail-Merchandising anbieten. Alle Merchandising-Artikel
sind bestickt, um die bestmögliche und langlebige Qualität zu gewährleisten.<br /> <br />
Wenn Sie die Open-Source-Community unterstützen und Deine
Lieblings-Go-Mail-Bibliothek mit einem coolen Drip repräsentieren möchten,
besuchen Sie unseren Merch-Shop unter:
[https://www.hellotux.com/go-mail](https://www.hellotux.com/go-mail).
13 changes: 5 additions & 8 deletions content/de/examples/bulk-mailer.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,11 +90,11 @@ func main() {
m.SetDate()
m.SetBulk()
m.Subject(fmt.Sprintf("%s, we have a great offer for you!", u.Firstname))
if err := m.SetBodyHTMLTemplate(htpl, u); err != nil {
log.Fatalf("failed to set HTML template as HTML body: %s", err)
if err := m.SetBodyTextTemplate(ttpl, u); err != nil {
log.Fatalf("failed to add text template to mail body: %s", err)
}
if err := m.AddAlternativeTextTemplate(ttpl, u); err != nil {
log.Fatalf("failed to set text template as alternative body: %s", err)
if err := m.AddAlternativeHTMLTemplate(htpl, u); err != nil {
log.Fatalf("failed to add HTML template to mail body: %s", err)
}

ms = append(ms, m)
Expand All @@ -110,9 +110,6 @@ func main() {
}
log.Printf("Bulk mailing successfully delivered.")
}
}
}
}
```

Nehmen wir das Beispiel mal auseinander, um uns ein paar Details anzuschauen...
Expand All @@ -125,6 +122,6 @@ Als Nächstes erstellen wir eine Liste von Nutzern, an die wir unser tolles Mass

Bei Massenmails ist es üblich, dass die `ENVELOPE FROM` und die `MAIL FROM` unterschiedlich sind, so dass Bounce-Mails an ein System gesendet werden, das diese Bounces im lokalen System als gebounced markieren kann. Deshalb setzen wir diese beiden von Adressaten in [Zeile 73](#hl-0-73) und [Zeile 76](#hl-0-76). Die Zeilen [79](#hl-0-79) bis [85](#hl-0-85) sollten dich nicht überraschen, wenn du go-mail schon einmal benutzt hast.

Eine weitere wichtige Sache passiert in [Zeilen 86](#hl-0-86) bis [91](#hl-0-91), in denen wir unsere vorbereiteten `html/template` und `text/template` Vorlagen verwenden und sie mit `m.SetBodyHTMLTemplate` und `m.AddAlternativeTextTemplate` auf unsere E-Mail-Nachricht anwenden. Wir stellen dieser Methode die gesamte Benutzerstruktur als Daten zur Verfügung, so dass `html/template` und `text/template` sich um das Ersetzen der Platzhalter im Mailkörper kümmern können. Go-mail kümmert sich um den ganzen Schnickschnack mit der Vorlagenbearbeitung für dich. Da unsere Mailnachricht nun vollständig ist, fügen wir sie in [Zeile 93](#hl-0-93) an unsere Mailnachrichtenscheibe an.
One more interesting thing happens in [lines 86](#hl-0-86) thru [91](#hl-0-91) in which we use our prepared `html/template` and `text/template` templates and apply it to our mail message using `m.SetBodyTextTemplate` and `m.AddAlternativeHTMLTemplate`. Wir stellen dieser Methode die gesamte Benutzerstruktur als Daten zur Verfügung, so dass `html/template` und `text/template` sich um das Ersetzen der Platzhalter im Mailkörper kümmern können. Go-mail kümmert sich um den ganzen Schnickschnack mit der Vorlagenbearbeitung für dich. Da unsere Mailnachricht nun vollständig ist, fügen wir sie in [Zeile 93](#hl-0-93) an unsere Mailnachrichtenscheibe an.

Zum Schluss erstellen wir einen neuen [Client](/reference/client/) und senden alle unsere vorbereiteten Nachrichten in einem Rutsch, indem wir die gesamte Nachrichtenscheibe an `Client.DialAndSend` übergeben.
2 changes: 1 addition & 1 deletion content/zh/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -138,5 +138,5 @@ With the `SendError` type the user is able to get detailed information about del
{{< /columns >}}

## 支持
We have a support and general discussion channel on Discord. Find us at: [#go-mail](https://discord.gg/dbfQyC4s) We have a support and general discussion channel on Discord. Find us at: [#go-mail](https://discord.gg/dbfQyC4s) 找到我们:[#go-mail](https://discord.gg/dbfQyC4s) We have a support and general discussion channel on Discord. Find us at: [#go-mail](https://discord.gg/dbfQyC4s) 找到我们:[#go-mail](https://discord.gg/dbfQyC4s)
We have a support and general discussion channel on Discord. Find us at: [#go-mail](https://discord.gg/dbfQyC4s) We have a support and general discussion channel on Discord. Find us at: [#go-mail](https://discord.gg/dbfQyC4s) 找到我们:[#go-mail](https://discord.gg/dbfQyC4s) We have a support and general discussion channel on Discord. Find us at: [#go-mail](https://discord.gg/dbfQyC4s) 找到我们:[#go-mail](https://discord.gg/dbfQyC4s) We have a support and general discussion channel on Discord. Find us at: [#go-mail](https://discord.gg/dbfQyC4s) 找到我们:[#go-mail](https://discord.gg/dbfQyC4s)

4 changes: 2 additions & 2 deletions content/zh/community/guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,14 @@ go-mail is an open source, community driven project. We welcome anyone to join u

### 开发新功能

We are always keen to add features to go-mail. The process for adding new features are as follows: 添加新功能的过程如下: 添加新功能的过程如下: 添加新功能的过程如下:
We are always keen to add features to go-mail. The process for adding new features are as follows: 添加新功能的过程如下: 添加新功能的过程如下: 添加新功能的过程如下: 添加新功能的过程如下:

* Check the [issue section on Github](https://github.com/wneessen/go-mail/issues) for available issues with the "TODO" or "help wanted" tag
* If no open "TODO"/"help wanted" issue is found or the feature you have in mind is not covered, please open a proposal issue for that specific feature and wait for the "OK" from the project maintainers
* 开发之前,请检查问题是否包括以下信息:
* 增强的目的
* 增强范围之外的内容
* If the issue does not include this information, feel free to request the information from the person who opened the issue. Sometimes placeholder issues are created and require more details 有时会创建占位符问题并需要更多详细信息 有时会创建占位符问题并需要更多详细信息 有时会创建占位符问题并需要更多详细信息
* If the issue does not include this information, feel free to request the information from the person who opened the issue. Sometimes placeholder issues are created and require more details 有时会创建占位符问题并需要更多详细信息 有时会创建占位符问题并需要更多详细信息 有时会创建占位符问题并需要更多详细信息 有时会创建占位符问题并需要更多详细信息
* 在问题上发表评论,说明您希望开发该功能
* 克隆存储库并创建格式为`feature/<issue_number>_<issue_title>`的分支
* New features often require documentation so please ensure you have also added or updated the documentation as part of the changes
Expand Down
10 changes: 10 additions & 0 deletions content/zh/community/merch.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
title: Merchandising
---

Thanks to our wonderful friends at [HelloTux](https://www.hellotux.com) we can
offer great go-mail merchandising. All merch articles are embroidery
to provide the best and most long-lasting quality possible.<br /> <br />
If you want to support the open source community and represent your favourite
Go mail library with some cool drip, check out our merch shop at:
[https://www.hellotux.com/go-mail](https://www.hellotux.com/go-mail).
136 changes: 5 additions & 131 deletions content/zh/examples/bulk-mailer.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,129 +41,6 @@ online shop.

Check out our latest offer on https://acme.com and use your discount code today!

Your marketing team
at ACME Inc.`

htmlBodyTemplate = `<p>Hi {{.Firstname}},</p>
<p>we are writing your to let you know that this week we have an amazing offer for you.
package main

import (
"fmt"
ht "html/template"
"log"
"math/rand"
"os"
tt "text/template"
"time"

"github.com/wneessen/go-mail"
)

// User is a simple type allowing us to set a firstname, lastname and mail address
type User struct {
Firstname string
Lastname string
EmailAddr string
}

// Our sender information that will be used in the FROM address field
const (
senderName = "ACME Inc."
senderAddr = "noreply@acme.com"
)

const (
textBodyTemplate = `Hi {{.Firstname}},

we are writing your to let you know that this week we have an amazing offer for you.
Using the coupon code "GOMAIL" you will get a 20% discount on all our products in our
online shop.

Check out our latest offer on https://acme.com and use your discount code today!

Your marketing team
at ACME Inc.`

htmlBodyTemplate = `<p>Hi {{.Firstname}},</p>
<p>we are writing your to let you know that this week we have an amazing offer for you.
package main

import (
"fmt"
ht "html/template"
"log"
"math/rand"
"os"
tt "text/template"
"time"

"github.com/wneessen/go-mail"
)

// User is a simple type allowing us to set a firstname, lastname and mail address
type User struct {
Firstname string
Lastname string
EmailAddr string
}

// Our sender information that will be used in the FROM address field
const (
senderName = "ACME Inc."
senderAddr = "noreply@acme.com"
)

const (
textBodyTemplate = `Hi {{.Firstname}},

we are writing your to let you know that this week we have an amazing offer for you.
Using the coupon code "GOMAIL" you will get a 20% discount on all our products in our
online shop.

Check out our latest offer on https://acme.com and use your discount code today!

Your marketing team
at ACME Inc.`

htmlBodyTemplate = `<p>Hi {{.Firstname}},</p>
<p>we are writing your to let you know that this week we have an amazing offer for you.
package main

import (
"fmt"
ht "html/template"
"log"
"math/rand"
"os"
tt "text/template"
"time"

"github.com/wneessen/go-mail"
)

// User is a simple type allowing us to set a firstname, lastname and mail address
type User struct {
Firstname string
Lastname string
EmailAddr string
}

// Our sender information that will be used in the FROM address field
const (
senderName = "ACME Inc."
senderAddr = "noreply@acme.com"
)

const (
textBodyTemplate = `Hi {{.Firstname}},

we are writing your to let you know that this week we have an amazing offer for you.
Using the coupon code "GOMAIL" you will get a 20% discount on all our products in our
online shop.

Check out our latest offer on https://acme.com and use your discount code today!

Your marketing team
at ACME Inc.`

Expand Down Expand Up @@ -213,11 +90,11 @@ func main() {
m.SetDate()
m.SetBulk()
m.Subject(fmt.Sprintf("%s, we have a great offer for you!", u.Firstname))
if err := m.SetBodyHTMLTemplate(htpl, u); err != nil {
log.Fatalf("failed to set HTML template as HTML body: %s", err)
if err := m.SetBodyTextTemplate(ttpl, u); err != nil {
log.Fatalf("failed to add text template to mail body: %s", err)
}
if err := m.AddAlternativeTextTemplate(ttpl, u); err != nil {
log.Fatalf("failed to set text template as alternative body: %s", err)
if err := m.AddAlternativeHTMLTemplate(htpl, u); err != nil {
log.Fatalf("failed to add HTML template to mail body: %s", err)
}

ms = append(ms, m)
Expand All @@ -233,9 +110,6 @@ func main() {
}
log.Printf("Bulk mailing successfully delivered.")
}
}
}
}
```

Let's take the example apart to look at some details...
Expand All @@ -248,6 +122,6 @@ Next we set up a list of users, we want to send our great bulk mailing to. [Line

For bulk mailings it is common that the `ENVELOPE FROM` and the `MAIL FROM` differ, so that bounce mails are sent to some system that can mark those bounces in the local system as bounced. Therefore we set both of those from addresses in [line 73](#hl-0-73) and [line 76](#hl-0-76). The lines [79](#hl-0-79) to [85](#hl-0-85) should be of no surprise to you, if you already used go-mail before. Therefore we set both of those from addresses in [line 73](#hl-0-73) and [line 76](#hl-0-76). The lines [79](#hl-0-79) to [85](#hl-0-85) should be of no surprise to you, if you already used go-mail before.

One more interesting thing happens in [lines 86](#hl-0-86) thru [91](#hl-0-91) in which we use our prepared `html/template` and `text/template` templates and apply it to our mail message using `m.SetBodyHTMLTemplate` and `m.AddAlternativeTextTemplate`. We provide the whole user struct as data to that methods, so that `html/template` and `text/template` can take care of replacing placeholders in the mail body. Go-mail will take care of all the bells and whistles with the template handling for you. With our mail message now complete, we append it to our mail message slice in [line 93](#hl-0-93). We provide the whole user struct as data to that methods, so that `html/template` and `text/template` can take care of replacing placeholders in the mail body. Go-mail will take care of all the bells and whistles with the template handling for you. With our mail message now complete, we append it to our mail message slice in [line 93](#hl-0-93). We provide the whole user struct as data to that methods, so that `html/template` and `text/template` can take care of replacing placeholders in the mail body. Go-mail will take care of all the bells and whistles with the template handling for you. With our mail message now complete, we append it to our mail message slice in [line 93](#hl-0-93). We provide the whole user struct as data to that methods, so that `html/template` and `text/template` can take care of replacing placeholders in the mail body. Go-mail will take care of all the bells and whistles with the template handling for you. With our mail message now complete, we append it to our mail message slice in [line 93](#hl-0-93).
One more interesting thing happens in [lines 86](#hl-0-86) thru [91](#hl-0-91) in which we use our prepared `html/template` and `text/template` templates and apply it to our mail message using `m.SetBodyTextTemplate` and `m.AddAlternativeHTMLTemplate`. We provide the whole user struct as data to that methods, so that `html/template` and `text/template` can take care of replacing placeholders in the mail body. Go-mail will take care of all the bells and whistles with the template handling for you. With our mail message now complete, we append it to our mail message slice in [line 93](#hl-0-93).

Finally we create a new [Client](/reference/client/) and send out all of our prepared messages in one go by providing the whole slice of messages to `Client.DialAndSend`.
43 changes: 43 additions & 0 deletions content/zh/getting-started/introduction.md
Original file line number Diff line number Diff line change
Expand Up @@ -207,5 +207,48 @@ m.SetBodyString(mail.TypeTextPlain, "Do you like this mail? I certainly do!") I
if err := c.DialAndSend(m); err != nil {
log.Fatalf("failed to send mail: %s", err)
}
}
m.Subject("This is my first mail with go-mail!")
m.SetBodyString(mail.TypeTextPlain, "Do you like this mail? I certainly do!") I certainly do!")
func main() {
m := mail.NewMsg()
if err := m.From("toni.sender@example.com"); err != nil {
log.Fatalf("failed to set From address: %s", err)
}
if err := m.To("tina.recipient@example.com"); err != nil {
log.Fatalf("failed to set To address: %s", err)
}
m.Subject("This is my first mail with go-mail!")
m.SetBodyString(mail.TypeTextPlain, "Do you like this mail? I certainly do!")
c, err := mail.NewClient("smtp.example.com", mail.WithPort(25), mail.WithSMTPAuth(mail.SMTPAuthPlain),
mail.WithUsername("my_username"), mail.WithPassword("extremely_secret_pass"))
if err != nil {
log.Fatalf("failed to create mail client: %s", err)
}
if err := c.DialAndSend(m); err != nil {
log.Fatalf("failed to send mail: %s", err)
}
}
m.Subject("This is my first mail with go-mail!")
m.SetBodyString(mail.TypeTextPlain, "Do you like this mail? I certainly do!") I certainly do!")
c, err := mail.NewClient("smtp.example.com", mail.WithPort(25), mail.WithSMTPAuth(mail.SMTPAuthPlain),
mail.WithUsername("my_username"), mail.WithPassword("extremely_secret_pass"))
if err != nil {
log.Fatalf("failed to create mail client: %s", err)
}
if err := c.DialAndSend(m); err != nil {
log.Fatalf("failed to send mail: %s", err)
}
}
m.Subject("This is my first mail with go-mail!")
m.SetBodyString(mail.TypeTextPlain, "Do you like this mail? I certainly do!") I certainly do!")
c, err := mail.NewClient("smtp.example.com", mail.WithPort(25), mail.WithSMTPAuth(mail.SMTPAuthPlain),
mail.WithUsername("my_username"), mail.WithPassword("extremely_secret_pass"))
if err != nil {
log.Fatalf("failed to create mail client: %s", err)
}
if err := c.DialAndSend(m); err != nil {
log.Fatalf("failed to send mail: %s", err)
}
}
```
Loading