Using partial fields in emails

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

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

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.