# Using partial fields in emails

**URL:** <https://forum.mautic.org/t/using-partial-fields-in-emails/9637>\
**Category:** Product Support\
**Created:** [October 5, 2017, 1:09pm UTC](https://forum.mautic.org/t/using-partial-fields-in-emails/9637 "2017-10-05T13:09:35Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![digitalsmithy](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/digitalsmithy/32/137_2.png) [@digitalsmithy](https://forum.mautic.org/u/digitalsmithy)\
**Post date:** [October 5, 2017, 1:09pm UTC](https://forum.mautic.org/t/using-partial-fields-in-emails/9637/1 "2017-10-05T13:09:35Z")

</div>

I’d like to construct a code from the customer company, todays date YEAR and some letters.  
  
Example: Bloggs Burgers. The code would be: BLOG2017XYZ  
  
First four letters of company, then year, then string.  
  
Then add this code into an email.  
  
What would be the best way?  
  
Is it possible to get the first four digits of a field? The least coding preferred - so not changing any core files that will get overwritten in an update.  
  
Can I do it all in the email?  
  
Thanks in advance  
  
Mike

---

<div class="post-metadata">

**Author:** ![digitalsmithy](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/digitalsmithy/32/137_2.png) [@digitalsmithy](https://forum.mautic.org/u/digitalsmithy)\
**Post date:** [October 5, 2017, 1:09pm UTC](https://forum.mautic.org/t/using-partial-fields-in-emails/9637/2 "2017-10-05T13:09:35Z")

</div>

I’d like to construct a code from the customer company, todays date YEAR and some letters.  
Example: Bloggs Burgers. The code would be: BLOG2017XYZ  
First four letters of company, then year, then string.  
Then add this code into an email.  
What would be the best way?  
Is it possible to get the first four digits of a field? The least coding preferred - so not changing any core files that will get overwritten in an update.  
Can I do it all in the email?  
Thanks in advance  
Mike

---

<div class="post-metadata">

**Author:** ![petertl](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/petertl/32/511_2.png) [@petertl](https://forum.mautic.org/u/petertl)\
**Post date:** [October 5, 2017, 6:36pm UTC](https://forum.mautic.org/t/using-partial-fields-in-emails/9637/3 "2017-10-05T18:36:19Z")

</div>

I don’t thinks it is possible with standard functionality. An approach would be custom database field with a trigger which creates the LEFT-string. But this is kind of dirty.
