Add Mailgun tags to the message.
Tag limit is 3.

@param string|array $tags

@return \Bogardo\Mailgun\Mail\Message
770985
public function tag($tags)
    {
        $tags = array_slice((array)$tags, 0, 3);
        foreach ($tags as $tag) {
            $this->messageBuilder->addTag($tag);
        }

        return $this;
    }
829854
public function addTag(Tag $tag)
    {
        if (!$this->tags->contains($tag)) {
            $this->tags->add($tag);
            return true;
        }
        return false;
    }
330018
private function group_tags(array $tags){
    $res = [];
    if ( !empty($tags) ){
      foreach ( $tags as $i => $tag ){
        // Skip the 'memberof' tag
        if ( $tag['tag'] === 'memberof' ){
          continue;
        }
        $t = $tag['tag'];
        unset($tag['tag']);
        $res[$t][] = $tag['text'] ?? $tag;
      }
    }
    return array_map(function($r){
      if ( is_array($r) && (count($r) === 1) ){
        return $r[0];
      }
      return $r;
    }, $res);
  }
1373301
public function set_tags($tags) {
        $this->tags = [];
        foreach ($tags as $tag) {
            // We use $tag->id as the key for the array so not only it handles duplicates of the same tag being given,
            // but also it is consistent with the behaviour of set_tags_by_id() below.
            $this->tags[$tag->id] = $tag;
        }
    }
872738
public function setAllowedTags($tags)
        {
            if(!is_array($tags)) {
                $tags = [$tags];
            }
            $this->allowedTags = $tags;
            return $this;
        }
852117
public function add($tag)
    {
        if (!$tag instanceof TagInterface) {
            throw new \InvalidArgumentException('This tag is not allowed');
        }
        if ($this->isUniqueTag($tag->getName())) {
            $this->removeByName($tag->getName());
        }

        return parent::add($tag);
    }
101019
public function tag($tags)
    {
        $tags = $this->makeTagsArray($tags);

        $this->addTags($tags);

        if (count($tags) > 0) {
            $this->tags()->sync(
                Tag::whereIn('tag', $tags)->pluck('id')->all()
            );

            return;
        }

        $this->tags()->detach();
    }
1370177
protected function FormatTags($Tags) {
      // Don't bother if there aren't any tags
      if (!$Tags)
         return '';
      
      // Get the array
      $TagsArray = Gdn_Format::Unserialize($Tags);     
      
      // Compensate for deprecated space-separated format 
      if (is_string($TagsArray) && $TagsArray == $Tags)
         $TagsArray = explode(' ', $Tags);
      
      // Safe format
      $TagsArray = Gdn_Format::Text($TagsArray);
      
      // Send back an comma-separated string
      return implode(',', $TagsArray);
   }
389023
public function tag($tag, array $keys)
	{
		foreach ($keys as $key)
		{
			$resolvedKey = $this->resolveAlias($key);

			if (!isset($this->tags[$tag]))
			{
				$this->tags[$tag] = array();
			}

			$this->tags[$tag][] = $resolvedKey;
		}

		// Prune duplicates
		$this->tags[$tag] = array_unique($this->tags[$tag]);

		return $this;
	}
398142
public function tags($tags): self
    {
        $tags = (array) $tags;

        $tags = array_merge($this->tags, $tags);

        $this->tags = array_unique($tags);

        return $this;
    }
502909
public function setTags($tags)
    {
        foreach ($tags as $key => $value) {
            $this->setTag($key, $value);
        }
    }
863552
public function allowTags(array $allowedTags):BBCode{
		$this->allowed = [];

		foreach($allowedTags as $tag){
			$tag = strtolower($tag);

			if(in_array($tag, $this->tags, true)){
				$this->allowed[] = $tag;
			}
		}

		return $this;
	}
748042
public function addTag(TagInterface $tag)
    {
        if (!$this->tags->contains($tag)) {
            $this->tags->add($tag);
        }

        return $this;
    }
1247663
protected function newMatchAllQuery($tags = [])
    {
        $tags = (array) $tags;
        $grammar = $this->media()->getBaseQuery()->getGrammar();
        return $this->media()->newPivotStatement()
            ->where($this->media()->getMorphType(), $this->media()->getMorphClass())
            ->whereIn('tag', $tags)
            ->groupBy($this->mediaQualifiedRelatedKey())
            ->havingRaw('count('.$grammar->wrap($this->mediaQualifiedRelatedKey()).') = '.count($tags));
    }
756274
public function setTags($tags)
    {
        $this->tags = [];
        $this->ref = null;

        if (is_array($tags)) {
            foreach ($tags as $tag) {
                $this->addTag($tag);
            }
        } else {
            $this->addTag($tags);
        }

        return $this;
    }
475303
protected function getFormattedTags(array $tags)
    {
        $add =array();

        foreach ($tags as $key => $value) {
            if (is_bool($value)) {
                $value = $value ? "true" : "false";
            }
            $add[] = "#$key:$value";
        }

        return !empty($add) ? '|'.implode(',', $add) : null;
    }
1149040
public function addTag($tag)
    {
        if (!\in_array(ExtTagInterface::class, \class_implements($tag), true)) {
            throw new Exception(\sprintf('The class %s must be implement interface %s', $tag, ExtTagInterface::class));
        }

        $this->tags[] = $tag;
        return $this;
    }