Update email function fixed.

| Q             | A
| ------------- | ---
| Bug fix?      | no
| New feature?  | no
| BC breaks?    | no
| Fixed tickets |  #1197
| Refs tickets  |
| License       | MIT