title: Swiftmailer: dbReplacements by user id?
body: <p>The Swiftmailer docs says you can create your own class to handle replacements using the Decorator plugin:</p>
  
  <pre><code>class DbReplacements implements Swift_Plugins_Decorator_Replacements {
    public function getReplacementsFor($address) {
      $sql = sprintf(
        "SELECT * FROM user WHERE email = '%s'",
        mysql_real_escape_string($address)
      );
  
      $result = mysql_query($sql);
  
      if ($row = mysql_fetch_assoc($result)) {
        return array(
          '{username}'=&gt;$row['username'],
          '{password}'=&gt;$row['password']
        );
      }
    }
  }
  </code></pre>
  
  <p>But in my case my database contains duplicated email address, i.e. the same address can appear on 3-4 accounts, so I need to get the replacements based on the user id instead.</p>
  
  <p>How do I modify the above class to match my criteria?</p>