def remind_all(self, request, subscription_uuid=None):
        """
        Reminds all users in the subscription who have a pending license that their license is awaiting activation.

        Additionally, updates all pending licenses to reflect that a reminder was just sent.
        """
        # Validate the text sent in the data
        self._validate_data(request.data)

        subscription_plan = self._get_subscription_plan()
        pending_licenses = subscription_plan.licenses.filter(
            status=constants.ASSIGNED)
        if not pending_licenses:
            return Response('Could not find any licenses pending activation',
                            status=status.HTTP_404_NOT_FOUND)

        pending_user_emails = [
            license.user_email for license in pending_licenses
        ]
        # Send activation reminder email to all pending users
        send_reminder_email_task.delay(
            self._get_custom_text(request.data),
            pending_user_emails,
            subscription_uuid,
        )

        return Response(status=status.HTTP_200_OK)
    def remind(self, request, subscription_uuid=None):
        """
        Given a single email in the POST data, sends a reminder email that they have a license pending activation.

        This endpoint reminds users by sending an email to the given email address, if there is a license which has not
        yet been activated that is associated with that email address.
        """
        # Validate the user_email and text sent in the data
        self._validate_data(request.data)

        # Make sure there is a license that is still pending activation associated with the given email
        user_email = request.data.get('user_email')
        subscription_plan = self._get_subscription_plan()
        try:
            License.objects.get(
                subscription_plan=subscription_plan,
                user_email=user_email,
                status=constants.ASSIGNED,
            )
        except ObjectDoesNotExist:
            msg = 'Could not find any licenses pending activation that are associated with the email: {}'.format(
                user_email, )
            return Response(msg, status=status.HTTP_404_NOT_FOUND)

        # Send activation reminder email
        send_reminder_email_task.delay(
            self._get_custom_text(request.data),
            [user_email],
            subscription_uuid,
        )

        return Response(status=status.HTTP_200_OK)