We would like to maintain the emails that are sent from our ASP.NET Web Application in a database. The idea was that the format of emails are stored in a database.
The problem is that emails should include order specific information, e.g.:
Thank you for your order John Smith,
your order 1234 has been received
What I'm trying to achieve is that I have used string verbatims in the database column values where it would be stored like this:
Thank you for your order {o.customer},
your order {o.id} has been received
I'm curious as to whether it is possible to do string interpolation where the values are already in the string that is formatted. If I try to use String.Format(dbEmailString)
it throws me exception:
An exception of type 'System.FormatException' occurred in mscorlib.dll but was not handled in user code
Additional information: Input string was not in a correct format.