Plugin Updated With thanks to Dabbledoo the plugin has now been updated to V1.1 The SQL query has been modified slightly and a new function to provide an unsubscribe URL has now been created. Many thanks Dabbledoo (Doug).
Hiya,
Another very quick and simple plugin this one. Just does the one job so far and that is to check whether the logged in user is signed up for a certain mailing list.
Usage
{exp:list_member list_name="default"}
{if member_of_list}
You <strong><em>are</em></strong> a member of the <strong>{list_name} - {list_title}</strong> mailing list
<a href="http://{unsubscribe_url}">Unsubscribe</a>
{if:else}
You <strong><em>are not</em></strong> a member of the <strong>{list_name} - {list_title}</strong> mailing list
{/if}
{/exp:list_member}
If the logged-in member is a member of the mailing list short name that you provide in the plugin parameter then the success message in the member_of_list conditional will be shown. If they either aren’t a member of the list or you have provided the wrong list_name parameter then the other message will be shown instead.
I wasn’t really too sure of what to do if people provide a list name in the parameter which doesn’t exist so the member_of_list error message will show on both counts. I am looking into this though to perhaps do something different depending on whether the user is a member or if someone provides an incorrect parameter.
Hope it helps someone somewhere though.
Best wishes,
Mark
Well actually I very very quickly wrote the plugin in answer to this post here.
Thought it might have some uses.
Best wishes,
Mark
Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.