# Sending email and want to change the language of bodytext email

**URL:** <https://forum.getkirby.com/t/sending-email-and-want-to-change-the-language-of-bodytext-email/18867>\
**Category:** Questions\
**Tags:** v3\
**Created:** [July 23, 2020, 2:01pm UTC](https://forum.getkirby.com/t/sending-email-and-want-to-change-the-language-of-bodytext-email/18867 "2020-07-23T14:01:27Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![joranovski](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/joranovski/32/106_2.png) [@joranovski](https://forum.getkirby.com/u/joranovski)\
**Post date:** [July 23, 2020, 2:01pm UTC](https://forum.getkirby.com/t/sending-email-and-want-to-change-the-language-of-bodytext-email/18867/1 "2020-07-23T14:01:27Z")

</div>

From the contact form on a site I can send email, but I want to change the bodytext in the email to dutch.

I use the Uniform plugin but I can’t find the place where I can edit the text.

this is the controller code:

```auto
<?php

use Uniform\Form;

return function ($kirby)
{
    $contactform = new Form([
        'email' => [
            'rules' => ['required', 'email'],
            'message' => 'E-mailadres is verplicht',
        ],
        'recipient' => [
            'rules' => ['required'],
            'message' => 'Kies een ontvanger',
        ]
        ,
        'name' => [
            'rules' => ['required'],
            'message' => 'Naam is verplicht',
        ],
        'message' => [
            'rules' => ['required'],
            'message' => 'Boodschap is verplicht',
        ],
    ]);

    if ($kirby->request()->is('POST')) {
        $contactform->emailSelectAction([
            'from' => 'info@kindkans.nl',
            'allowed-recipients' => [
                'Test2' => 'joranovski@gmail.com',
            ],
        ])
        ;
    }

    return compact('contactform');
};

```

Which results in an email with this plaintext:

![Screenshot 2020-07-23 at 15.59.38](https://europe1.discourse-cdn.com/flex017/uploads/getkirby/original/2X/7/7f9cd51ff4e75b641a0c356a15481869d2b3fa8f.png)

These are the settings in the site/config.php  
 ![Screenshot 2020-07-23 at 14.30.28](https://europe1.discourse-cdn.com/flex017/uploads/getkirby/original/2X/f/f0bd2ecb8e7a929dcc10978017cbbb4fe420ec02.png)

---

<div class="post-metadata">

**Author:** ![joranovski](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/joranovski/32/106_2.png) [@joranovski](https://forum.getkirby.com/u/joranovski)\
**Post date:** [July 23, 2020, 2:34pm UTC](https://forum.getkirby.com/t/sending-email-and-want-to-change-the-language-of-bodytext-email/18867/2 "2020-07-23T14:34:14Z")

</div>

Ok, I just kept on searching and could it be that the answer I’m looking for can be found in the EmailAction.php from the Uniform template?

---

<div class="post-metadata">

**Author:** ![texnixe](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/texnixe/32/5754_2.png) [@texnixe](https://forum.getkirby.com/u/texnixe)\
**Post date:** [July 23, 2020, 4:43pm UTC](https://forum.getkirby.com/t/sending-email-and-want-to-change-the-language-of-bodytext-email/18867/3 "2020-07-23T16:43:36Z")

</div>

There is a template that you should be able to override with your own email template.

---

<div class="post-metadata">

**Author:** ![joranovski](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/joranovski/32/106_2.png) [@joranovski](https://forum.getkirby.com/u/joranovski)\
**Post date:** [July 24, 2020, 8:34am UTC](https://forum.getkirby.com/t/sending-email-and-want-to-change-the-language-of-bodytext-email/18867/4 "2020-07-24T08:34:59Z")

</div>

Thanks, but after some thorough reading of all the documentation of the plugin,  
I see that the fieldnames are displayed throught this bit

```auto
echo ucfirst($field).': '.$value."\n";

```

So I changed the names on the inputs and the controller and in the EmailSelectAction.php to the dutch counterparts and that did work.

But that doesn’t feel like the most elegant solution if you have a multilingual site.  
But for now my problem is solved

---

<div class="post-metadata">

**Author:** ![pixelijn](https://avatars.discourse-cdn.com/v4/letter/p/7ab992/32.png) [@pixelijn](https://forum.getkirby.com/u/pixelijn)\
**Post date:** [July 24, 2020, 8:41am UTC](https://forum.getkirby.com/t/sending-email-and-want-to-change-the-language-of-bodytext-email/18867/5 "2020-07-24T08:41:23Z")

</div>

> [@joranovski](#):
>
> But that doesn’t feel like the most elegant solution if you have a multilingual site.  
> But for now my problem is solved

In a multilanguage environment you could work with translation variables. Or create your own email templates.

---

<div class="post-metadata">

**Author:** ![joranovski](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/joranovski/32/106_2.png) [@joranovski](https://forum.getkirby.com/u/joranovski)\
**Post date:** [July 24, 2020, 9:13am UTC](https://forum.getkirby.com/t/sending-email-and-want-to-change-the-language-of-bodytext-email/18867/6 "2020-07-24T09:13:27Z")

</div>

@pixelijn @texnixe the only thing left now is to define the template with which I can send the mail.  
In which file do I have to configure this.

this snippet I Can alter but where do I put it? In the site/config.php file?

I’ve already put the templates in the site/templates/emails/ folder

```auto
$kirby->email([
  'to' => 'peter@lustig.de',
  'template' => 'my-email',
  'data' => [
    'num' => '2'
  ]
]);

```

I guess I’m in a squeeze between the Uniform plugin and the native Kirby email functionality

---

<div class="post-metadata">

**Author:** ![pixelijn](https://avatars.discourse-cdn.com/v4/letter/p/7ab992/32.png) [@pixelijn](https://forum.getkirby.com/u/pixelijn)\
**Post date:** [July 24, 2020, 10:03am UTC](https://forum.getkirby.com/t/sending-email-and-want-to-change-the-language-of-bodytext-email/18867/7 "2020-07-24T10:03:01Z")

</div>

> The email action accepts the same options than the [email function of Kirby](https://getkirby.com/docs/guide/emails).  
> [Email - Kirby Uniform](https://kirby-uniform.readthedocs.io/en/latest/actions/email/)

So you can tell the plugin to use the template you defined in your template folder.

---

<div class="post-metadata">

**Author:** ![joranovski](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/joranovski/32/106_2.png) [@joranovski](https://forum.getkirby.com/u/joranovski)\
**Post date:** [July 24, 2020, 10:15am UTC](https://forum.getkirby.com/t/sending-email-and-want-to-change-the-language-of-bodytext-email/18867/8 "2020-07-24T10:15:44Z")

</div>

Yeah, but i doesn’t select the proper template in my case.  
I want to send an HTML email, so I created a file named my-email.html.php in the site/templates/emails folder and in the controller which looks like this

 ![Screenshot 2020-07-24 at 12.14.52](https://europe1.discourse-cdn.com/flex017/uploads/getkirby/original/2X/5/5e1a78a7d69545151cbfb02ac362ee2347b3ad6d.png)

---

<div class="post-metadata">

**Author:** ![texnixe](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/texnixe/32/5754_2.png) [@texnixe](https://forum.getkirby.com/u/texnixe)\
**Post date:** [July 24, 2020, 7:43pm UTC](https://forum.getkirby.com/t/sending-email-and-want-to-change-the-language-of-bodytext-email/18867/9 "2020-07-24T19:43:58Z")

</div>

Have you tested if a basic text template works, i.e. without the `html` name part?
