Search

Hi,

Another question about the Members extension. I need to be able to make some member accounts expire/deactivate after 3 months. I'm thinking this can be done by having a date field with the expiry date and using that within my xslt to only show stuff to logged in members who have an expiry date that is greater than the current date.

Is this the approach others would take?

I also need to send a reminder email to accounts that are about to expire. I was thinking of setting up a cron job that would run once a day that would visit a url with a datasource with all the email addresses that are applicable. Could this approach be used with an event and the email template manager?

Is there anything I should look out for with an unknown number of email addresses?

I think I remember reading something about this on the forums recently.

Regarding Members expiry, the easiest way is probably the XSLT solution. But it may not be easy to maintain, depending on the complexity of your site and your templates. Solving this on the PHP level, however, will be much more tricky (and I myself have no idea where to start).

Regarding the reminder email, keep in mind that the Email Template Manager (ETM) has not been built to send very much emails. It incorporates, for example, no throttling. So if you send a lot of emails, your risk of getting flagged as spammer is higher than necessary. The second point is: Sending is not a background process but an Apache process. So it will time out if you are sending too many emails.

For these (and some more) reasons the Email Newsletter Manager (ENM) has been built. It can send to virtually any number of recipients. Instead of a datasource of recipients you would define an ETM Recipient Group.

But: Using cron and/or writing to the Members section upon sending (e.g. to a "date of last reminder email" field) will require custom code. You will need to work with the ENM's API to "create" and start the newsletter. In addition to that, the ENM's delegates may be helpful:

  • PreEmailGenerate
  • PreEmailSend
  • PostEmailSend

If you need some example code how to work with the ENM's API, please tell me. I could probably find something for you. (I am actually "remote controlling" all newsletters from a dedicated admin frontend — built from Datasources, Events, XSLT and a bit of PHP extension code. There should be some code, somewhere, how to start a newsletter...)

Thanks @micheal-e for the detailed response. The site is relatively simple so maintaining things through xslt should be fine. Thanks for the explanation of the ENM, that looks like just the ticket.

The job is not confirmed yet, but I wanted to check everything was do-able from my perspective before agreeing to it. Looks like it should be :)

If the site goes ahead i'd like to take you up on the offer on code examples, php isn't my strong point.

Thanks again.

Create an account or sign in to comment.

Symphony • Open Source XSLT CMS

Server Requirements

  • PHP 5.3-5.6 or 7.0-7.3
  • PHP's LibXML module, with the XSLT extension enabled (--with-xsl)
  • MySQL 5.5 or above
  • An Apache or Litespeed webserver
  • Apache's mod_rewrite module or equivalent

Compatible Hosts

Sign in

Login details