move mailgun to functions

Subject and messaget (text) is now also dynamic.