TampereHacklab / mulysa

Mulysa member management for Hacklabs
GNU General Public License v3.0
6 stars 11 forks source link

Option to subscribe to mailinglist at register #265

Open olmari opened 3 years ago

olmari commented 3 years ago

At least an checkbox in registation form to subscribe to hacklab mailinglist, additionally could be option somewhere in user settings to add/remove oneself from the list.

Technical part is to have mailinglist subscribe and unsubscribe addresses defined in Mulysa settings and then Mulysa will send mail with user's email address depending what user has chosen.

I'd do it purely as registation part, as users can unsub/sub themselves too, but this way users wiuld eve nrealise such mailing list exist (should an lab have one).

tswfi commented 3 years ago

The idea with mulysa emails is that it is sent to all members with or without subscription. The emails are meant as "this is important information for our members, you will get these if you are a member"

Other "nice to know" newsletter stuff are better handled somewhere else.

olmari commented 3 years ago

Exactly why the "nice to know" stuff is the voluntary mailinglist and not done through Mulysa involuntary database :) But subscribing to such can still be easy option and registation form has proven to be exactly good place for it in the past.

tswfi commented 3 years ago

so would that be an integration to mailchimp or similar?

olmari commented 3 years ago

More of stupid mailto: event to defined address in Mulysa settings, Vaasa exmple is members+subscribe@example.hacklab.fi, or that is the way Vaasa had last manager doing it. Mailinglist can be anytihng anywhere, not otherwise related to Mulysa.

tswfi commented 3 years ago

and how would that work if I want to add personal@example.com that has spf + dkim + dmarc set so that only example.com is allowed to send emails? the subscribe address would never see the email.

olmari commented 3 years ago

At least vaasa has control on their mailinglist too, namely google groups in this case, but same worked with older Trex offered mailman instance too. Would need to dig Asylum code to make heads or tails about exact details what it does, but at any case it has always worked when properly set up.

tswfi commented 3 years ago

I'm pretty sure google wont subscribe an email address that is sent from invalid domain.

olmari commented 3 years ago

Generally mailinglists allows such behaviour, even googles own one. That is part of the reason confirmation is usually performed in general case. And even more so, Vaasa hacklab is allowed to send mail inside vaasa hacklab domain, where both sending and receiving end happends (sender still uses vaasa credentials on google smtp relay). At mailman there were some config options, which I can't bother to serve from memory, long abandoned system from vaasa :)

tswfi commented 3 years ago

oh well, does not hurt to try.

define the contents of the email (and the headers) and I can add a signal to trigger "subsribe" email if the checkbox is checked in registration.

olmari commented 3 years ago

Dug from Asylum code I found this:

        mailman_subscribe = env('VAASA_MAILMAN_SUBSCRIBE', default=None)
        if mailman_subscribe:
            mail = EmailMessage()
            mail.from_email = member.email
            mail.to = [mailman_subscribe, ]
            mail.subject = 'subscribe'
            mail.body = 'subscribe'
            mail.send()

Where mailman_subscribe is the mentioned subscription address that is read from settings somewhere.

Obviously option should be exposed to member applicant only if such thing exist in settings etc, but that's finer details...

ADD: from gapps sending policy specifically, key point to have is Allowed senders: Any addresses on the relay-configuration.