Is it possible to generate an 'Opt In' link for mail contact?

Is it possible to generate an 'Opt In' link for mail contact?

As we will need express permission as of next Friday (GDPR) to email and SMS a consumer/candidate, does anyone know if it's possible to generate some kind of 'Opt In' link to send to candidates that will then show on their record?

Cheers,
Steve