<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def send(self):
 """ Sends the email to the recipient If the sending fails will set the status of the instance to "error" and will log the error according to your project's django-logging configuration """

        if self.content_type.name == 'node':
            to = [self.to.user.email]
        elif self.content_type.name == 'layer':
            to = [self.to.email]
            # layer case is slightly special, mantainers need to be notified as well
            # TODO: consider making the mantainers able to switch off notifications
            for mantainer in self.to.mantainers.all().only('email'):
                to += [mantainer.email]
        else:
            to = [self.to.email]

        context = {
            'sender_name': self.from_name,
            'sender_email': self.from_email,
            'message': self.message,
            'site': settings.SITE_NAME,
            'object_type': self.content_type.name,
            'object_name': str(self.to)
        }
        message = render_to_string('mailing/inward_message.txt', context)

        email = EmailMessage(
            # subject
            _('Contact request from %(sender_name)s - %(site)s') % context,
            # message
            message,
            # from
            settings.DEFAULT_FROM_EMAIL,
            # to
            to,
            # reply-to header
            headers={'Reply-To': self.from_email}
        )

        import socket
        # try sending email
        try:
            email.send()
            self.status = 1
        # if error
        except socket.error as e:
            # log the error
            import logging
            log = logging.getLogger(__name__)
            error_msg = 'nodeshot.community.mailing.models.inward.send(): %s' % e
            log.error(error_msg)
            # set status of the instance as "error"
            self.status = -1