Creating buttons in HTML for your mailer is notoriously difficult. To get them to render consistently across the various email clients is a real challenge.
I believe this code was created by Yannick on codepen. I simply wrote the code that replaces the variables.