1) You need to “brand your links”. See the first response from SendGrid below for details and a link to instructions.

See here: https://sendgrid.com/docs/ui/account-and-settings/how-to-set-up-link-branding/

https-ssl in Sendgrid

2) Then, under “Settings > Tracking” in your SendGrid account, you need to turn “click tracking” OFF.

For the complete solution reported by one of our users (shanhua):

https://wordpress.org/support/topic/https-not-being-added-to-linked-attachments-when-email-form-is-sent/#post-10657315