dbprovider/mongodb/mailnotifier.go
func (m MongoDb) SaveMailNotifier(ctxt string, notifier models.MailNotifier) error {
	c := m.Connect(models.COLL_NAME_MAIL_NOTIFIER)
	defer m.Close(c)
	_, err := c.Upsert(bson.M{}, bson.M{"$set": notifier})
	if err != nil {
		logger.Get().Error("%s-Error Updating the mail notifier info for: %s Error: %v", ctxt, notifier.MailId, err)
		return errors.New(fmt.Sprintf("Error Updating the mail notifier info for: %s Error: %v", notifier.MailId, err))
	}
	return nil
}
func (m MongoDb) SaveMailNotifier(ctxt string, notifier models.MailNotifier) error {
	c := m.Connect(models.COLL_NAME_MAIL_NOTIFIER)
	defer m.Close(c)
	_, err := c.Upsert(bson.M{}, bson.M{"$set": notifier})
	if err != nil {
		logger.Get().Error("%s-Error Updating the mail notifier info for: %s Error: %v", ctxt, notifier.MailId, err)
		return errors.New(fmt.Sprintf("Error Updating the mail notifier info for: %s Error: %v", notifier.MailId, err))
	}
	return nil
}
// Save mail notifier adds a new mail notifier, it replaces the existing one if there
// is already a notifier available.