Class RequestItemEmailNotifier


  • @Singleton
    public class RequestItemEmailNotifier
    extends Object
    Send item requests and responses by email.

    The "strategy" by which approvers are chosen is in an implementation of RequestItemAuthorExtractor which is injected by the name requestItemAuthorExtractor. See the DI configuration documents.

    Author:
    Mark H. Wood
    • Constructor Detail

    • Method Detail

      • sendRequest

        public void sendRequest​(Context context,
                                RequestItem ri,
                                String responseLink)
                         throws IOException,
                                SQLException
        Send the request to the approver(s).
        Parameters:
        context - current DSpace session.
        ri - the request.
        responseLink - link back to DSpace to send the response.
        Throws:
        IOException - passed through.
        SQLException - if the message was not sent.
      • sendResponse

        public void sendResponse​(Context context,
                                 RequestItem ri,
                                 String subject,
                                 String message)
                          throws IOException
        Send the approver's response back to the requester, with files attached if approved.
        Parameters:
        context - current DSpace session.
        ri - the request.
        subject - email subject header value.
        message - email body (may be empty).
        Throws:
        IOException - if sending failed.
      • requestOpenAccess

        public void requestOpenAccess​(Context context,
                                      RequestItem ri)
                               throws IOException
        Send, to a repository administrator, a request to open access to a requested object.
        Parameters:
        context - current DSpace session
        ri - the item request that the approver is handling
        Throws:
        IOException - if the message body cannot be loaded or the message cannot be sent.