# Automatic email

**URL:** <https://community.silverfin.com/t/automatic-email/1526>\
**Category:** Templates\
**Created:** [July 16, 2019, 9:47am UTC](https://community.silverfin.com/t/automatic-email/1526 "2019-07-16T09:47:09Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![sylvia.debaeremaeker](https://avatars.discourse-cdn.com/v4/letter/s/9de053/32.png) [@sylvia.debaeremaeker](https://community.silverfin.com/u/sylvia.debaeremaeker)\
**Post date:** [July 16, 2019, 9:47am UTC](https://community.silverfin.com/t/automatic-email/1526/1 "2019-07-16T09:47:09Z")

</div>

Hi

We were wondering if it is possible to automatically send an email to a colleague if f.i. in the reconcilitation template Checklist WCO the company is marked as ‘bedreigd’?

---

<div class="post-metadata">

**Author:** ![sven](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.silverfin.com/sven/32/1495_2.png) [@sven](https://community.silverfin.com/u/sven)\
**Post date:** [July 18, 2019, 8:24pm UTC](https://community.silverfin.com/t/automatic-email/1526/2 "2019-07-18T20:24:30Z")

</div>

Hey @sylvia.debaeremaeker,

Why not use Silverfin Insights for that? This allows you to do this within Silverfin, as it can create a note (or todo) automatically in the concerning company file (which your colleague will be following obviously, and he will be notified of this).

All communication is then in that note, instead of having a mail-thread outside of Silverfin.

A use case can be found [here](https://nl.help.silverfin.com/article/225-insights-workflows-instellen).

If not clear, let us known. Good to know is that Silverfin Insights can access all data from every company file (accounts, or a boolean as I’m thinking your marking of “bedreigd” will be done with a boolean perhaps, or maybe it’s a local var? Either way, all of that can be called upon by Silverfin Insights).

---

<div class="post-metadata">

**Author:** ![sylvia.debaeremaeker](https://avatars.discourse-cdn.com/v4/letter/s/9de053/32.png) [@sylvia.debaeremaeker](https://community.silverfin.com/u/sylvia.debaeremaeker)\
**Post date:** [July 23, 2019, 6:54am UTC](https://community.silverfin.com/t/automatic-email/1526/3 "2019-07-23T06:54:15Z")

</div>

Hi Sven

It is possible to obtain a list with all the ‘bedreigd’ companies via Insights. But we also need to know when the stamp ‘bedreigd’ was given. Is it possible to get a time stamp via Insights?

---

<div class="post-metadata">

**Author:** ![sven](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.silverfin.com/sven/32/1495_2.png) [@sven](https://community.silverfin.com/u/sven)\
**Post date:** [July 23, 2019, 7:22am UTC](https://community.silverfin.com/t/automatic-email/1526/4 "2019-07-23T07:22:02Z")

</div>

Hi @sylvia.debaeremaeker,

It is possible to get a list with all the companies, and you can get the timestamp from a database variable as well, as explained here :

> [@CASE: make header with additional info in a recon template](https://community.silverfin.com/t/case-make-header-with-additional-info-in-a-recon-template/861):
>
> Within a recon template, you can make a beautiful header with contains some additional info that might come in handy for the user(s) that need to use the recon template. It could also be used to distinguish your custom templates from others as well. An example: In order to achieve this, you need to create your table first (to make the code more readable, we’ll try to put the code between stripnewlines as much as possible - see more info [here](https://community.silverfin.com/t/case-make-your-code-readable-with-stripnewlines-and-newline/366) ). {% comment %} Below code gives a header…

Give it a try, like this perhaps:

Code reconciliation:

```auto
{% input custom.bedreigd.comp as:boolean %}

{% result 'bedreigd' custom.bedreigd.comp.updated_at %} 

```

Filter through Insights:  
 ![30](https://canada1.discourse-cdn.com/flex030/uploads/getsilverfin/original/2X/5/5d5a9e6d1ab4ca3e4961144080f229187060d116.png)

where we look where the boolean is checked

and  
 ![34](https://canada1.discourse-cdn.com/flex030/uploads/getsilverfin/original/2X/1/108b8d1d34a0902a18077dee1110caebc20dd093.png)  
where we take the value of when it was checked by the result tag.

---

<div class="post-metadata">

**Author:** ![sylvia.debaeremaeker](https://avatars.discourse-cdn.com/v4/letter/s/9de053/32.png) [@sylvia.debaeremaeker](https://community.silverfin.com/u/sylvia.debaeremaeker)\
**Post date:** [July 23, 2019, 8:04am UTC](https://community.silverfin.com/t/automatic-email/1526/5 "2019-07-23T08:04:21Z")

</div>

Hi Sven

So i added this to the code in the template

> | {% t “Conclusie op basis van professional judgement” %} | |  
> |-------------------75%-------------------------|----20%-----|---------+  
> | {% t "Continuïteit is " %} {% input custom.detail.bedreigd as:select options:“bedreigd|niet bedreigd” %}.| |{% if custom.detail.bedreigd != blank %} {% assign ind = 0 %} {% else %} {% assign ind = 1 %} {% endif %} {% unexplained ind as:indicator %}  
> | {% input custom.letter.Commentaar as:text size:mini %} | |  
> {% result ‘bedreigd’ custom.detail.bedreigd.updated\_at %}

And this to my Insights report:  
 ![image](https://canada1.discourse-cdn.com/flex030/uploads/getsilverfin/original/2X/9/948ed3623d46bdfe44c7c8780025f6ace2aac653.png)

I tried it with one file as a test, but the date was not displayed.

---

<div class="post-metadata">

**Author:** ![sven](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.silverfin.com/sven/32/1495_2.png) [@sven](https://community.silverfin.com/u/sven)\
**Post date:** [July 23, 2019, 8:25am UTC](https://community.silverfin.com/t/automatic-email/1526/6 "2019-07-23T08:25:14Z")

</div>

@sylvia.debaeremaeker,

I’d advise to take the `updated_at` attribute into a result tag and then filter on “show all” in Insights.

Could you give that a try?

---

<div class="post-metadata">

**Author:** ![sylvia.debaeremaeker](https://avatars.discourse-cdn.com/v4/letter/s/9de053/32.png) [@sylvia.debaeremaeker](https://community.silverfin.com/u/sylvia.debaeremaeker)\
**Post date:** [July 23, 2019, 10:19am UTC](https://community.silverfin.com/t/automatic-email/1526/7 "2019-07-23T10:19:28Z")

</div>

Hi Sven

i’ve tried to add a result tag, but this is the result in my template:

![image](https://canada1.discourse-cdn.com/flex030/uploads/getsilverfin/original/2X/f/f674d4602334b5f7073f2ad8b05c96deaa4760ca.png)

> | {% t “Conclusie op basis van professional judgement” %} | |  
> |-------------------75%-------------------------|----20%-----|---------+  
> | {% t "Continuïteit is " %} {% input custom.detail.bedreigd as:select options:“bedreigd|niet bedreigd” %}.| |{% if custom.detail.bedreigd != blank %} {% assign ind = 0 %} {% else %} {% assign ind = 1 %} {% endif %} {% unexplained ind as:indicator %}  
> | {% input custom.letter.Commentaar as:text size:mini %} | |  
> {{ $30+custom.detail.bedreigd.updated\_at }}

---

<div class="post-metadata">

**Author:** ![sven](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.silverfin.com/sven/32/1495_2.png) [@sven](https://community.silverfin.com/u/sven)\
**Post date:** [July 23, 2019, 10:54am UTC](https://community.silverfin.com/t/automatic-email/1526/8 "2019-07-23T10:54:25Z")

</div>

@sylvia.debaeremaeker,

You should add a result tag in the template so you can reference to it from somewhere else, like this:

```auto
| {% t “Conclusie op basis van professional judgement” %} | |
|-------------------75%-------------------------|----20%-----|---------+
| {% t "Continuïteit is " %} {% input custom.detail.bedreigd as:select options:“bedreigd|niet bedreigd” %}.| |{% if custom.detail.bedreigd != blank %} {% assign ind = 0 %} {% else %} {% assign ind = 1 %} {% endif %} {% unexplained ind as:indicator %}
| {% input custom.letter.Commentaar as:text size:mini %} | |

{% result "bedreigd" custom.detail.bedreigd.updated_at %}

```

So this part was missing from your code:

`{% result "bedreigd" custom.detail.bedreigd.updated_at %}`

More info for result tags can be found here:

> [@CASE reference values across templates by using result tags](https://community.silverfin.com/t/case-reference-values-across-templates-by-using-result-tags/1157):
>
> If you want to reference a certain value or variable from recon template A in another template, there’s a way to do it with the so-called result tags in STL. They work like this (bulb just type in result and press TAB to get this preformatted code bulb): {% result 'name' content %} where the name is a shortname you can choose, and the content is the value or variable you want to reference to. Let’s say we have this variable done\_prepayments in our recon template Prepayments (which is al…

PS registers can only be used to take in values, so this code:  
`{{ $30+custom.detail.bedreigd.updated_at }}` can never work as well.

---

<div class="post-metadata">

**Author:** ![sylvia.debaeremaeker](https://avatars.discourse-cdn.com/v4/letter/s/9de053/32.png) [@sylvia.debaeremaeker](https://community.silverfin.com/u/sylvia.debaeremaeker)\
**Post date:** [July 23, 2019, 12:45pm UTC](https://community.silverfin.com/t/automatic-email/1526/9 "2019-07-23T12:45:05Z")

</div>

Hi Sven

Thank you, now i can add the time stamp to the insights

---

<div class="post-metadata">

**Author:** ![sven](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.silverfin.com/sven/32/1495_2.png) [@sven](https://community.silverfin.com/u/sven)\
**Post date:** [July 23, 2019, 12:49pm UTC](https://community.silverfin.com/t/automatic-email/1526/10 "2019-07-23T12:49:32Z")

</div>


